Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / ResumeSprite() - Ability to alter the animation settings...

Author
Message
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 7th Mar 2012 14:31 Edited at: 7th Mar 2012 14:34
There is currenly no way to alter the animation settings (Speed, Loop, FromFrame, ToFrame) when resuming an animation (ResumeSprite()). I was just about to add this to the enhancements list but wanted to check first to ensure there isn't a way of me doing this in code...

Say for example I have an animation which flicks through 20 frames, if I stop the animation on frame 10 and want to resume from this position, but increase the speed of the animation, I do not believe I can achieve this.

Does anyone have any suggestions before I submit this as an enhancement?

I tried this:



But this then only loops between the CurrentFrame and the End Frame...

It would be good to have something like this:

MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 7th Mar 2012 14:55 Edited at: 7th Mar 2012 15:06
you can use

SetSpriteFrame(BoxAnim,Frame_to_go)

just after your

PlaySprite(BoxAnim, Speed, 1, 1, GetSpriteFrameCount(BoxAnim))


it will make the animation jump to this frame

So :



You can also alter speed with SetSpriteSpeed( iSpriteIndex, fFps ).

From these functions you can easily create a custom ResumeSprite command
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 7th Mar 2012 15:03
Thats why I love this forum, so helpful...

A simple, yet perfect solution! Thanks MikeMax!
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 7th Mar 2012 15:05
You're welcome you can easily recreate a custom ResumeSprite function (i have edited the end of my first post)

Login to post a reply

Server time is: 2024-05-07 23:22:30
Your offset time is: 2024-05-07 23:22:30