draw_primitive_end

Ends the process of defining a primitive and draws it.

Syntax:

GML Code Example

draw_primitive_end()


Returns: N/A


Description

This function must be called when you have finished defining the points of your primitive. If you do not call this function, nothing will be drawn as this effectively tells GameMaker: Studio that you have finished and that it can now draw the defined primitive.


Example:

GML Code Example

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.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here