Py5Shape.end_shape()

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

Examples

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


def draw():
    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 Java method: PShape.endShape

Syntax

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

Parameters

  • mode: int - Either OPEN or CLOSE

Updated on September 11, 2021 16:51:34pm UTC