GM: image index
From GMpedia.org Wiki
- The correct title of this article is image_index. It appears incorrectly here because of technical restrictions.
|
image_index | |
| Type: | variable |
| Globalism: | Local |
| Editable: | Yes |
The image_index local variable is the variable that defines the current subimage of the current selected sprite. A sprite in meaning is an graphic with multiple sub-images. Every sub-image in Game Maker has an index, starting from 0 (which is the first image) and ending with whatever the user decides the number of sub-images should be.
Since Game Maker 6.x, image_index alone controls the position of the image in the sprite of the object. In previous version, another variable: GM: image_single existed.
A sprite of an object, by default, is constantly moving, and therefore image_index keeps changing, and therefore it cannot be used to pause a sprite (unless used in step), what can be used, however, is the GM variable: image_speed.

