Posted: 5th Aug 2024 0:41
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:
+ Code Snippet
agk::PlaySprite(my_sprite_index);
Posted: 5th Aug 2024 20:33
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.

+ Code Snippet
int currentFrame = agk::GetSpriteCurrentFrame(mySprite);

agk::Update(0);

if (agk::GetSpriteCurrentFrame(mySprite) != currentFrame)
{
  // update sprite here
}

agk::Render()
agk::Swap()
Posted: 6th Aug 2024 1:05
You are right.
Updating the sprite between Update() and Render() did it.
Thanks!