beginShape

v0.1.7
beginShape([mode]);

Begin adding vertices to a custom shape.

Arguments

[mode]The opengl shape mode LINES, POINTS, QUADS, TRIANGLES, TRIANGLE_FAN , default is LINES

The mode param is not completely implemented in lu5-wasm

function setup()
  createWindow(300, 300);
end

function draw()
  background('purple');

  beginShape();
    vertex(150,  50);
    vertex(170, 130);
    vertex(250, 130);
    vertex(185, 170);
    vertex(210, 250);
    vertex(150, 200);
    vertex( 90, 250);
    vertex(115, 170);
    vertex( 50, 130);
    vertex(130, 130);
  endShape();
end

Output

See beginShape in shapes.h