background_get_name(index);
Argument | Description |
---|---|
index | The background image asset to get the name of. |
Returns: String
This function will return the name as a string of the specified background. This name is the one that has been specified for the background 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 background directly - for that you would need the background index. You can, however, use this string to get the
background index using the returned string along with the function asset_get_index().
name = background_get_name(bck_1);
The above code gets the name of the background asset indexed in "bck_1" and stores it as a string in the instance variable "name".