Legacy GM sprite_index - not sure how it works

F

Facet

Guest
Hello

I have important part with saving sprite_index, like a
Code:
object_get_sprite(inst.object_index)
I have some errors and reason can be elsewhere, but to be sure, I want to know how sprite_index works. With calling object_get_sprite(inst.object_index) I have number and this is ok. But when I will add new sprite to project it can change? For example, if I will move new sprite, lets say #99 in my project to position #3 it will be move all sprites over #3 to sprite_index +1??? I think, sprite_index should be always same for each created sprite just by the create/add to project number.
 
A

Azure Spectre

Guest
What sort of errors are you getting? That code should theoretically work fine. Assuming "inst" is an instance id, that would return the default sprite of the object type of that instance. If you are looking for the current sprite, it would simply be "inst.sprite_index".
 
F

Facet

Guest
What sort of errors are you getting? That code should theoretically work fine. Assuming "inst" is an instance id, that would return the default sprite of the object type of that instance. If you are looking for the current sprite, it would simply be "inst.sprite_index".
I think it should work and it worked. Just for some reason it drawing different sprite when I created other sprite. I think problem is elsewhere, some missing instance or sprite just hard to find and to be sure, I need to know, sprite_index for already created sprite can change some way or not?
 
Top