When the image has multiple sub-images the program cycles through them. This variable indicates the currently drawn sub-image (they are numbered starting from 0). You can change the current image by changing this variable. The program will continue cycling, starting at this new index. (The value can have a fractional part. In this case it is always rounded down to obtain the subimage that is drawn.)



In this example, the sprite will jump to subimage 2 (the third frame of the animation).
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License