How do I change sprite sheets on an event?

How do I code it so I can change a characters sprite sheet when say going from idle to jump, for example. I haven’t come across a good example anywhere.

Not sure if this helps you, but you can have a look at an old blog post I wrote here: http://bitstopixels.blogspot.com/2016/10/simplifying-sprites-and-image-sheets-in.html

I have created my own class called Spright, which I use to simplify handling of sprites and sprite sheets. You can just grab the code from the blog post if you want to.

Other than that I guess you can have a look here: https://docs.coronalabs.com/guide/media/imageSheets/index.html

2 Likes

Thank you for the help!

1 Like