Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Noob problem with TNTAnimator — Gideros Forum

Noob problem with TNTAnimator

eclisseeclisse Member
edited May 2013 in General questions
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

Sign In or Register to comment.