draw_primitive_begin


语法:

draw_primitive_begin(kind)


参数 描述
kind The kind of primitive you are going to draw.


返回:

N/A(无返回值)


描述

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:


例如:

var i, steps, xx, yy, radius;
steps=20;
xx=50;
yy=50;
radius=30;
draw_primitive_begin(pr_trianglefan);
draw_vertex(xx, yy);
for(i = 0; i <= steps; i += 1)
   {
   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.