sprite_get

From Rivals of Aether Unofficial Workshop Manual


This function will get the unique identifying index for a custom sprite file located in your workshop mod's sprites folder. When called from a stage, this function searches in the path sprites/articles. If the sprite file is not found, the function will return the index of the built-in sprite "net_disc_spr" instead.

Syntax[edit | edit source]

sprite_get( sprite );

Arguments[edit | edit source]

Argument Type Description
sprite string The name of the sprite, without the file extension or _strip#

Returns[edit | edit source]

int (sprite index)

Examples[edit | edit source]

Basic[edit | edit source]

// post_draw.gml
// draws the sprite "my_sprite_strip#.png" at the player's x and y coordinates
draw_sprite( sprite_get( "my_sprite" ), 0, x, y );

Advanced[edit | edit source]

// init.gml
// stores the sprite in a variable to use later (this is slightly more performant)
spr_my_sprite = sprite_get( "my_sprite" );
// draw_hud.gml
// draws the sprite to the hud
draw_sprite( spr_my_sprite, 0, temp_x, temp_y );

See Also[edit | edit source]

Cookies help us deliver our services. By using our services, you agree to our use of cookies.