Actor Tweening onMotionFinished

rool

  • Posts: 3
hi,
i wanted to know if there is some function to detect when a tweening function is finished like in actionscript when you can use onMotionFinished. I did'nt find anything about it in the community or help.

thank you

Alexin

  • *
  • Posts: 3127
Stencyl uses Caurina's Tweener. When adding a tween, you have the option to provide a callback to know when the tween is done.

I'm attaching an AS3 soruce file as an example of how I handle tweens. In particular, the the example uses tweening to move an actor. Due to timing issues, the final position of the actor may be off by a couple of pixels (quite bad for low-res games), so I use a callback to precisely palce the actor when the tween is done.

Note that you don't need to use bitwise operations to keep track of tweens. I happened to do it that way because of an assignment (they're handy if you have plenty of tweens to track though).
"Find the fun"
alexin@stencyl.com

rool

  • Posts: 3
thank you! i'm going to use that
and sorry but the callback is not available as a block in design mode?