Py5Shape.get_children()#

Get the children of a Py5Shape object as a list of Py5Shape objects.

Examples#

example picture for get_children()
1def setup():
2    us_map = py5.load_shape("us_map.svg")
3    for child in us_map.get_children():
4        py5.println(child.get_name())
5
6    py5.background(192)
7    py5.scale(0.1)
8    py5.translate(25, 225)
9    py5.shape(us_map, 0, 0)

Description#

Get the children of a Py5Shape object as a list of Py5Shape objects. When Processing loads shape objects, it may create a hierarchy of Py5Shape objects, depending on the organization of the source data file. This method will retrieve the list of Py5Shapes that are the child objects to a given object.

Underlying Processing method: PShape.getChildren

Syntax#

get_children() -> list[Py5Shape]

Updated on March 01, 2022 12:15:01pm UTC