2D Primitives

This section has the functions necessary for drawing 2D primitives.

A primitive is a type of drawing done using points to define what is shown on the screen. They can be made up of single points, lines, or triangles and can be coloured, have alpha blending and even be given a texture, which means that they can be used to create some very exciting effects in a 2D game! For example, you can create a rectangle using multiple triangle primitives, then texture it with a flag sprite and in the draw event of an instance have that flag "wave" in the wind and distort the sprite you used by simply modifying the points that form the primitive.

NOTE: These functions do not work with the HTML5 module unless you have enabled OpenGL in the Global Game Settings.

Information on primitives can be found in the following pages:

  1. draw_primitive_begin
  2. draw_primitive_begin_texture
  3. draw_primitive_end
  4. draw_vertex
  5. draw_vertex_colour
  6. draw_vertex_texture
  7. draw_vertex_texture_colour


Back: Reference
Next: Drawing Surfaces
© Copyright YoYo Games Ltd. 2018 All Rights Reserved