Weastøne Entertainment
Member
Hello,
I was programming when I encountered a recurring, but still relatively 'surprising', effect: I have a 2-subimages sprite and whenever I ask GameMaker2 for the subimage '2' (the 3rd one), it shows me number '0' (the 1st one). Is this regular behavior, or should I clamp manually the subimage index?
Thank you!
I was programming when I encountered a recurring, but still relatively 'surprising', effect: I have a 2-subimages sprite and whenever I ask GameMaker2 for the subimage '2' (the 3rd one), it shows me number '0' (the 1st one). Is this regular behavior, or should I clamp manually the subimage index?
GML:
// Example: 'spr' has 2 subimages and the following returns the same output:
draw_sprite(spr, 1, x, y);
draw_sprite(spr, 5, x, y); // Shouldn't this return an 'index out of range' error?
Thank you!