pause a sprite?
Moderator: Stef
pause a sprite?
How can I pause a sprite animation on the last frame and stop it looping?
-
- Very interested
- Posts: 710
- Joined: Sat Feb 18, 2012 2:44 am
Re: pause a sprite?
give the animation a loop variable. 1 means loop and 0 means don't loop. When you're incrementing the frame index, add a check: if it reaches the last frame and the loop variable is 0, then don't increment. It'll stay at the last frame.
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: pause a sprite?
If you are using SGDK sprite engine, also be sure to set the time parameter in the resource definition to 0 so you can manually control the animation for this sprite using SPR_nextFrame(..) or SPR_setFrame(..) methods.