Py5Shape.get_children()

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

Examples

example picture for get_children()
1
2
3
4
5
6
7
8
9
def setup():
    us_map = py5.load_shape("us_map.svg")
    for child in us_map.get_children():
        py5.println(child.get_name())

    py5.background(192)
    py5.scale(0.1)
    py5.translate(25, 225)
    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 Java method: PShape.getChildren

Syntax

get_children() -> List[Py5Shape]

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