Hi !
I'm starting to learn Gideros (after a long hiatus) and I've started tinkering with TNT Animator (great tools, Gianluca ! grazie, I'll donate as soon as I'm sure I can use them in a project).
I'm stuck with a strange problem.
I have an animated sprite and I want to toggle on and off the animation with a touch.
function CPlayer:onTouch(event)
if self:hitTestPoint(event.x, event.y) then
if self.anim:animationRunning() then
self.anim:stopAnimation()
else
self.anim:startAnimation()
end
event:stopPropagation()
end
end
At first tap the animation stops, then at second tap the application exits with the following error:
main.lua:58: attempt to call method 'startAnimation' (a nil value)
stack traceback:
main.lua:58: in function
Where is the noob mistake I'm surely making ?
What is the recommended way to handle touch events with regards to animations ?
Thanks
Paolo
Comments
Thanks a lot.