This function can be used to retrieve the sprite animation type as defined for the sprite resource in the Sprite Editor. The value returned will be one of the following constants:
| Constant | Description |
|---|---|
| spritespeed_framespersecond | The sprite was defined with animation in frames per second. |
| spritespeed_framespergameframe | The sprite was defined with in animation in frames per game frame. |
The following two examples illustrate the difference this can make when calculating animation speeds for the sprite:
You can find out what the speed value used for the sprite animation was using the function sprite_get_speed(), and you can set the animation speed and type using the function sprite_set_speed().
sprite_get_speed_type(index)
| Argument | Description |
|---|---|
| index | The index of the sprite to get the animation type of |
Constant (see above)
s_speed = sprite_get_speed(sprite_index);
s_type = sprite_get_speed_type(sprite_index);
The above code gets the sprite speed and the sprite animation type and stores them in instance variables for future use.