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 / [SOLVED] [Tier2] Animation Time?

Author
Message
Piettro
12
Years of Service
User Offline
Joined: 27th Oct 2011
Location:
Posted: 5th Aug 2024 00:41 Edited at: 5th Aug 2024 19:52
Hi,
when I use animation with agk:laySprite(my_sprite_index);
Would it be possible to get the time to the next frame?
I need to know the frame change right before the change itself. Because agk::Sync(); when changing the sprite's animation frame, it draws this frame already. Only after then, can I adjust a different sprite, so I get one FPS delay, which gives a small flick.
I hope this makes sense.
Otherwise, I will have to animate the sprite manually.

Thanks to everyone in advance!

Edit:

The author of this post has marked a post as an answer.

Go to answer

hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 5th Aug 2024 20:33 Edited at: 5th Aug 2024 20:50
This post has been marked by the post author as the answer.
You could try using Update() Render() and Swap() instead of Sync().

I haven't used c++ in a while so sorry if the code is not exactly right.

Piettro
12
Years of Service
User Offline
Joined: 27th Oct 2011
Location:
Posted: 6th Aug 2024 01:05
You are right.
Updating the sprite between Update() and Render() did it.
Thanks!

Login to post a reply

Server time is: 2024-09-14 23:16:28
Your offset time is: 2024-09-14 23:16:28