Hello all!
So I can be incredibly dense, so we have that to work with…but I’m missing the way to “pass” a variable to the “onRender” method? I mean, I want to insert new rows that AREN’T statically defined in a pre-existing table.
For example, I got a pubnub lobby going, and as new players appear in the lobby, I’d really like to add them to my tableview list thingy:
local function onRowRender( event )
local row = event.row
local rowGroup = event.view
local label = "Row ("
local color = 0
if row.isCategory then
label = "Category (";
color = 255
end
row.textObj = display.newRetinaText( rowGroup, label .. row.index .. ")", 0, 0, native.systemFont, 16 )
row.textObj:setTextColor( color )
row.textObj:setReferencePoint( display.CenterLeftReferencePoint )
row.textObj.x, row.textObj.y = 20, rowGroup.contentHeight \* 0.5
end
Now in the " label … row.index … “)”" part, how the hell would I assign it like a new label like playerName or id# or ANYTHING arbitrary? I’m just not wrapping my head around it.
Appreciate any help in advance!!
-Mario [import]uid: 11636 topic_id: 24551 reply_id: 324551[/import]