beginShape()
Draws a polygon with any number of given vertices.
Example
Syntax
Description
beginShape() and endShape() allow the drawing of shapes with many corners. After beginShape() is called, corners (vertices) should be listed, each on a separate line. After that, endShape() should be called to end the list. Corners are written in their x,y co-ordinates as vertex(x,y)
The inputs available for beginShape() are:
TESS Connects the edges and creates a closed region. This is the default behavior if nothing was given.
POINTS Draw a set of points
LINES Draw a set of unconnected line segments
TRIANGLES Draw a set of triangles
QUADS Draw a set of quadrilaterals
endShape(CLOSE)
connects the last vertex to the first one
endShape()
Find these documents helpful? Let the people who made them help your child learn to code at Strivemath!
We'd love to hear your Feedback/Comments here.
Last updated