Py5Shape.remove_child()#

Removes a child Py5Shape object from a parent Py5Shape object that is defined as a GROUP.

Examples#

example picture for remove_child()
 1def setup():
 2    us_map = py5.load_shape("us_map.svg")
 3    for child in us_map.get_children():
 4        if child.get_name()[0] not in 'AEIOU':
 5            us_map.remove_child(us_map.get_child_index(child))
 6
 7    py5.background(192)
 8    py5.scale(0.1)
 9    py5.translate(25, 225)
10    py5.shape(us_map, 0, 0)

Description#

Removes a child Py5Shape object from a parent Py5Shape object that is defined as a GROUP.

Underlying Processing method: PShape.removeChild

Syntax#

remove_child(idx: int, /) -> None

Parameters#

  • idx: int - index value

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