Advanced
The instance label of the object.
The instance name of the object.
Returns the first child in the container with the specified label. Recursive searches are done in a pre-order traversal.
Instance label to search for
Optional
deep: booleanWhether to search recursively through children
The first child with the specified label, or null if none found
// Basic label search
const child = container.getChildByLabel('player');
// Search with regular expression
const enemy = container.getChildByLabel(/enemy-\d+/);
// Deep search through children
const deepChild = container.getChildByLabel('powerup', true);
Instance name.
Optional
deep: booleanWhether to search recursively
The child with the specified name.
Returns all children in the container with the specified label. Recursive searches are done in a pre-order traversal.
Instance label to search for
Optional
deep: booleanWhether to search recursively through children
Optional
out: Container<ContainerChild>[]Optional array to store matching children in
An array of children with the specified label
// Basic label search
const enemies = container.getChildrenByLabel('enemy');
// Search with regular expression
const powerups = container.getChildrenByLabel(/powerup-\d+/);
// Deep search with collection
const buttons = [];
container.getChildrenByLabel('button', true, buttons);
The FindMixin interface provides methods for finding children within a container by their label. It allows for searching for a single child or multiple children with a specific label, either directly or recursively through the container's hierarchy.