[new to Defold; experienced programmer]
I am cloning a simple node tree that is a box with a label. Literally a colored box with a text subnode. The boxes are showing up, not the labels. The label is changing, as shown in my print statement, but not visible. Here is my code:
local cnode_tree = gui.clone_tree(gui.get_node(‘topicBtn’)) | |||
---|---|---|---|
local cnode = cnode_tree[hash(‘topicBtn’)] | |||
local tnode = cnode_tree[hash(‘topicT’)] | |||
print('setting topic: '…top) | |||
print('old label: '…tostring(gui.get_text(tnode))) | |||
gui.set_text(tnode, top) | |||
print('new label: '…tostring(gui.get_text(tnode))) | |||
gui.set_position(cnode,vmath.vector3(512,500-idx*82,0)) | |||
gui.set_layer(cnode, ‘results’) | |||
gui.move_above(tnode, cnode) | |||
gui.set_enabled(tnode, true) | |||
gui.set_visible(tnode, true) |
I am sure the last 3 are irrelevant, but just trying. The set_text and get_text are working, the label has the new text.
What am I forgetting?