Sprite get

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

Syntax
sprite_get( sprite );

Returns
real (sprite index)

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

Advanced
// init.gml // stores the sprite in a variable to use later (this is slightly more performant) spr_mysprite = sprite_get( "my_sprite" );

// draw_hud.gml // draws the sprite to the hud draw_sprite( spr_mysprite, 0, temp_x, temp_y );