I have created a GUI node - box and added texture “frog.atlas”. Even able to run animation via editor. Now, I am trying to run “frog” animation when a player tapped on node.
In the .gui_script, I received “touch” gesture and its node as well.
function on_input(self, action_id, action)
if action_id == hash("touch") and action.pressed then
local frog = gui.get_node("frog")
if gui.pick_node(frog, action.x, action.y) then
print("Frog clicked - do animation. ")
--Do Frog animation
end
end
end
As per [example],(https://www.defold.com/manuals/animation/#_gui_box_node_example),
gui.play_flipbook(frog, "frog")
//is not working
FYI, I have “game” game object -> “animal.gui” -> “frog” node with “frog_animation” node.