Py5Shape.get_family()

Get the Py5Shape object’s “family” number.

Examples

example picture for get_family()
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# family will be one of these values
SHAPE_FAMILY_VALS = {py5.Py5Shape.GROUP: 'GROUP',
                     py5.Py5Shape.PRIMITIVE: 'PRIMITIVE',
                     py5.Py5Shape.PATH: 'PATH',
                     py5.Py5Shape.GEOMETRY: 'GEOMETRY'}


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

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

Description

Get the Py5Shape object’s “family” number.

Underlying Java method: PShape.getFamily

Syntax

get_family() -> int

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