|kind||The kind of primitive you are going to draw.|
|tex||The texture to use with the primitive.|
This function must be called before you define the vertices of a
textured primitive. You must give the kind of primitive to use (see
more information) and the id of a texture to use, which can
be a sprite or background image asset. This asset id can be
gotten from the functions sprite_get_texture
(use -1 for no texture).
NOTE: For a texture to repeat it must be a power of two in size, ie: 32x32, 128x128, etc...
var tex = background_get_texture(background0);
draw_vertex_texture(0, 0, 0, 0);
draw_vertex_texture(640, 0, 1, 0);
draw_vertex_texture(640, 480, 1, 1);
draw_vertex_texture(0, 480, 0, 1);
The above code will draw a 4 vertex triangle strip (making a rectangle) textured with the texture held in the "tex" variable, and the whole texture will be used to cover the completed primitive.