Animations and Spritesheets¶
Animation system (Early stages)¶
If you want to draw a animation, then you can do it this way
Loading the animations¶
To load the animation, run
Drawing animation¶
To draw it then, run:
The frames specify the number of frames to draw each time. It can be as low as you like, or as high as you like, depending on the speed of the animation that you want.Spritesheets¶
Creating spritesheets¶
First, create your spritesheet. You can do it this way:
This will cut down your spritesheet in 100x100 pixels images. Then it will be places insidespr.frames
as Image
objects. The images are cut from corner up-left to up-right. Then it goes a row lower and cuts futher.
Then, set the size of each image and then set the coordinates. (This is required or else they will be automatically set to 0) Set the size:
This will set the size of each image 60x60 pixels. Then, set the coordinates:
This will set the X-axis and Y-axis to 50.