background_get_texture(back);
Argument | Description |
---|---|
back | The index of the background to use. |
Returns: Pointer
This function returns a pointer for the background texture page. This value can then be used in other draw functions, particularly in general 3D
and some of 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.
var tex;
tex = background_get_texture(back);
draw_primitive_begin_texture(pr_trianglestrip, tex);
draw_vertex_texture(0, 480, 0, 0);
draw_vertex_texture(640, 480, 1, 0);
draw_vertex_texture(640, 480, 1, 1);
draw_vertex_texture(0, 480, 0, 1);
draw_primitive_end();
The above code will draw a 4 vertex triangle strip textured with the texture held in the "tex" variable.