Same as getChild(name), except that it first walks all the way up the hierarchy to the eldest grandparent, so that children can be found anywhere.
(String target)
| 2019 | * hierarchy to the eldest grandparent, so that children can be found anywhere. |
| 2020 | */ |
| 2021 | public PShape findChild(String target) { |
| 2022 | if (parent == null) { |
| 2023 | return getChild(target); |
| 2024 | |
| 2025 | } else { |
| 2026 | return parent.findChild(target); |
| 2027 | } |
| 2028 | } |
| 2029 | |
| 2030 | |
| 2031 | // can't be just 'add' because that suggests additive geometry |