sprite_get_name

Gets the name of a sprite.

Syntax:

sprite_get_name(index);


Argument Description
index The index of the sprite to get the name of.


Returns: String


Description

This function will return the name as a string of the specified sprite. This name is the one that has been specified for the sprite in the resource tree of the main GameMaker: Studio window. Please note that this is only a string and cannot be used to reference the sprite directly - for that you would need the sprite index. You can, however, use this string to get the sprite index using the returned string along with the function asset_get_index().


Example:

str = sprite_get_name(sprite_index);

The above code will get the name of the sprite index for the instance running the code and store the return value in the variable "str".


Back: Sprites
Next: sprite_get_number
© Copyright YoYo Games Ltd. 2018 All Rights Reserved