tileset_get_texture


Description

This function returns a special pointer for the tileset texture page. This value can then be used in other draw functions, particularly in the 2D primitive functions, as well as the Shader functions. You can get more information about the returned texture page using the different texture_ functions found here.


Syntax:

tileset_get_texture(tileset);

Argument Description
tileset The index of the tileset to use.


Returns

Pointer (texture page ID)


Example:

var tex;
tex = tileset_get_texture(spr_Wall, 0);
draw_primitive_begin_texture(pr_trianglestrip, tex);
draw_vertex_texture(0, 0, 0, 0);
draw_vertex_texture(480, 0, 1, 0);
draw_vertex_texture(480, 640, 1, 1);
draw_vertex_texture(0, 640, 0, 1);
draw_primitive_end();

The above code will draw a 4 vertex triangle strip textured with the texture held in the "tex" variable.