Hi,
I create dynamically 2 nodes in my GUI: a text node and a box node.
The text node has to be the parent node of the box node.
When the text node moves in the screen, the box node doesn’t appear (and remains still anyway).
Could you help me?
This is the code:
local node_tondo = gui.new_box_node(message.position, vmath.vector3(80, 80, 0))
gui.set_texture(node_tondo, "gui")
gui.play_flipbook(node_tondo, "tondo_punteggio_volante")
gui.set_adjust_mode(node_tondo, gui.ADJUST_STRETCH)
local node = gui.new_text_node(message.position, tostring(message.amount))
gui.set_font(node, "main")
gui.set_color(node, vmath.vector4(1, 0, 0, 1))
gui.set_outline(node, vmath.vector4(0, 0, 0, 0))
gui.set_adjust_mode(node, gui.ADJUST_STRETCH)
gui.set_parent(node_tondo, node)
gui.animate(node, gui.PROP_COLOR, vmath.vector4(1, 0, 0, 1), gui.EASING_OUT, 0.3) -- fade in
gui.animate(node, gui.PROP_OUTLINE, vmath.vector4(0, 0, 0, 1), gui.EASING_OUT, 0.3)
local offset = vmath.vector3(0, 20, 0) -- float
gui.animate(node, gui.PROP_POSITION, gui.get_position(node) + offset, gui.EASING_NONE, 0.5, 0.0, float_done)
Thanks, Marco