When calling:
[sprite stopAllActions];
The AtlasSprite animation stops at the current frame.
Is there a way to set the sprite to a specific frame number (or even the first frame the sprite was instantiated with)?
Or must a new sprite be made?
A fast, easy to use, free, and community supported 2D game engine
When calling:
[sprite stopAllActions];
The AtlasSprite animation stops at the current frame.
Is there a way to set the sprite to a specific frame number (or even the first frame the sprite was instantiated with)?
Or must a new sprite be made?
[sprite setTextureRect: (CGRect) rect] works but it will skip instantly to that frame. If you want it to continue until that frame, Id use a schedule that checks for the right rect and then call my StopAllActions. You could subclass AtlasSprite and have a method [sprite StopTheActions]; that calls the said schedule to really stop it at the right frame.
I think the issue is stopAllActions calls the base class IntervalAction.stop. Getting the current action as an Animate class. Then you call myAnimate.stop and it should restoreOriginalFrame.
I store a pointer to the current Animate action for my sprite for easy reference.
if([self numberOfRunningActions] > 0)
{
[currentAnimate stop];
}You must log in to post.