tileset_get_uvs

This function returns an array with the UV coordinates and other data for the texture of the given tile set on the texture page. The function returns an array with the following 8 elements:

This array can then be used in other draw functions, particularly when working in 3D or using the 2D primitive functions, as well as when working with the Shader functions.

 

Syntax:

tileset_get_uvs(tileset);

ArgumentType Description
tilesetTile Set Asset The index of the tile set to use.

 

Returns

Array (1D, 8 elements)

 

Example:

var tex = tileset_get_uvs(tl_Grass);
tex_left = tex[0];
tex_top = tex[1];
tex_right = tex[2];
tex_bottom = tex[3];

The above code will store the UV coordinates for the given tile set in a local array and then assign the values to instance variables.