• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Stop background sprite animation

O

Occupant

Guest
I read this post, which seems very closely related to my issue:

https://forum.yoyogames.com/index.php?threads/sprite-animation-just-1-time-and-not-a-loop.8996/

In short, I want to stop the animation of the sprite assigned to my room background before it loops. The solution above talks about putting some image_speed = 0 code into the AnimationEnd event, but in GMS2, I don't see a way to interact with the animation events of the background sprite.

Is there another way to do this? I'd rather not create an instance layer object that displays the animated background sprite, because that will have side effects in my camera code.

Thanks for any help!
 

rIKmAN

Member
I read this post, which seems very closely related to my issue:

https://forum.yoyogames.com/index.php?threads/sprite-animation-just-1-time-and-not-a-loop.8996/

In short, I want to stop the animation of the sprite assigned to my room background before it loops. The solution above talks about putting some image_speed = 0 code into the AnimationEnd event, but in GMS2, I don't see a way to interact with the animation events of the background sprite.

Is there another way to do this? I'd rather not create an instance layer object that displays the animated background sprite, because that will have side effects in my camera code.

Thanks for any help!
You can use layer_background_speed() to set the speed of an animated background.
Read that page and do the maths for your particular background sprite (how many frames it will take to loop depending on the speed settings etc) and then stop it as required.
 
Top