Hello everyone, I’m a complete Defold newbie so my code might be a bit ugly.. In my menu, I have a button that you click to start the game, loading in a new collection. I would like the button to finish playing an animation after you click it before it loads in the new collection. Is that possible? I’ve tried using anim_callback in my gui script based off other people’s code I’ve seen, but it doesn’t work for me, so I think I’m doing it wrong? The loading in new collection works fine.
local function anim_callback(self.node)
end
function on_input(self, action_id, action)
if(action_id == hash("touch") and action.pressed == true) then
if gui.pick_node(gui.get_node("golvl1"), action.x, action.y) then
local golvl1 = guiget_node("golvl1")
gui.set_texture(golvl1, "button")
gui.play_flipbook(golvl1, "button1anim", anim_callback)
if gui.pick_node(gui.get_node("golvl1"), action.x, action.y) then
msg.post("proxy:/controller#controller", "show_lvl1")
end
end
end
end