draw_primitive_begin


Description

This function must be called before you can define any primitives. There are 6 types of primitives you can define with the following constants:


The following image illustrates basically how these should look and also the order in which you should define the vertexes:


Syntax:

draw_primitive_begin(kind)

Argument Description
kind The kind of primitive you are going to draw.


Returns:

N/A


Example:

var _steps = 20;
var _xx = 50;
var _yy = 50;
var _radius = 30;
draw_primitive_begin(pr_trianglefan);
draw_vertex(_xx, _yy);
for(var i = 0; i <= _steps; ++i;)
    {
    draw_vertex(_xx + lengthdir_x(_radius, 270 * i / _steps), _yy + lengthdir_y(_radius, 270 * i / _steps));
    }
draw_primitive_end();

The above code will draw three quarters of a circle made from primitives.