tileset_get_name


Description

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


Syntax:

tileset_get_name(index);

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


Returns

String


Example:

var _l = layer_get_id("tilemap_trees");
var _m = layer_tilemap_get_id(_l);
var _t = tilemap_tileset(_m);
tileset_name = tileset_get_name(_t);

The above code will get the name of the tileset index for the given layer, storing the return string in the variable tileset_name.