Py5Shape.get_kind()

Get the Py5Shape object’s “kind” number.

Examples

example picture for get_kind()
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# this is just a subset of the possible values
PY5SHAPE_KIND_VALS = {py5.Py5Shape.GROUP: 'GROUP',
                      py5.Py5Shape.ELLIPSE: 'ELLIPSE'}


def setup():
    s = py5.load_shape("bot.svg")
    for child in s.get_children():
        py5.println(PY5SHAPE_KIND_VALS[child.get_kind()])

    py5.background(192)
    py5.scale(0.25)
    py5.shape(s, py5.width//2, py5.height//2)

Description

Get the Py5Shape object’s “kind” number.

Underlying Java method: PShape.getKind

Syntax

get_kind() -> int

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