参数 描述 kind The kind of primitive you are going to draw.
This function must be called before you can define any primitives. There are 6 types of primitives you can define with the following constants:
- pr_trianglefan (This is not available on the HTML5 target platform and may not work correctly on some devices for other platforms)
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;
for(i = 0; i <= steps; i += 1)
draw_vertex(xx + lengthdir_x(radius, 270 * i / steps), yy + lengthdir_y(radius, 270 * i / steps));
The above code will draw three quarters of a circle made from primitives.