Py5Shape.end_shape()#

This method is used to complete a custom shape created with the create_shape() function.

Examples#

 1def setup():
 2    global s  # the Py5Shape object
 3    s = py5.create_shape()
 4    s.begin_shape()
 5    s.fill(0, 0, 255)
 6    s.no_stroke()
 7    s.vertex(0, 0)
 8    s.vertex(0, 50)
 9    s.vertex(50, 0)
10    s.end_shape()
11
12
13def draw():
14    py5.shape(s, 25, 25)

Description#

This method is used to complete a custom shape created with the create_shape() function. It’s always and only used with create_shape().

Underlying Processing method: PShape.endShape

Syntax#

end_shape() -> None
end_shape(mode: int, /) -> None

Parameters#

  • mode: int - Either OPEN or CLOSE

Updated on November 12, 2021 11:30:58am UTC