Py5Shape.get_family()#

Get the Py5Shape object’s “family” number.

Examples#

example picture for get_family()
 1# family will be one of these values
 2SHAPE_FAMILY_VALS = {py5.Py5Shape.GROUP: 'GROUP',
 3                     py5.Py5Shape.PRIMITIVE: 'PRIMITIVE',
 4                     py5.Py5Shape.PATH: 'PATH',
 5                     py5.Py5Shape.GEOMETRY: 'GEOMETRY'}
 6
 7
 8def setup():
 9    s = py5.load_shape("bot.svg")
10    for child in s.get_children():
11        py5.println(SHAPE_FAMILY_VALS[child.get_family()])
12
13    py5.background(192)
14    py5.scale(0.25)
15    py5.shape(s, py5.width//2, py5.height//2)

Description#

Get the Py5Shape object’s “family” number.

Underlying Processing method: PShape.getFamily

Syntax#

get_family() -> int

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