GameMaker [Solved] how to change image_index for a drawn sprite?

T

tobiasgjerstrup

Guest
hello guys. I was wondering how you change the image index for a sprite that you draw (not the sprite associated with the object)
 

Neptune

Member
You can change the built-in variable 'image_index' a lot of ways.
Code:
image_index = 3; // Set to 3 (the 4th image of your sprite, because the first frame is 0)
image_index ++; //Increment by 1
image_index --; //Decrement by 1
image_index += 3; //Increment by 3
Note the built in variable 'image_speed' will cycle the variable 'image_index' on its own, unless you set
Code:
image_speed = 0;
 
Top