class Camera
package s.markup.stage
extends StageObject › Object2D › Object
@:directlyUsed@:build(s.shortcut.ShortcutMacro.build())@:autoBuild(s.shortcut.ShortcutMacro.build())@:build(s.shortcut.ShortcutMacro.mixinBuild())@:allow(s.markup.stage.Stage)Constructor
Inherited Variables
Defined by StageObject
Defined by Object2D
Defined by Object
@:value(new s.shortcut.signals.Signal([]))read onlychildAdded:Signal<(child:T) ‑> Void> = new s.shortcut.signals.Signal([])
Fired when a direct child is added.
@:value(new s.shortcut.signals.Signal([]))read onlychildRemoved:Signal<(child:T) ‑> Void> = new s.shortcut.signals.Signal([])
Fired when a direct child is removed.
read onlychildren:ObjectList<T>
Direct child nodes.
The list manages ownership: adding a node here updates its parent, and removing it detaches it.
@:value(new s.shortcut.signals.Signal([]))read onlydescendantAdded:Signal<(descendant:T) ‑> Void> = new s.shortcut.signals.Signal([])
Fired when any descendant is added anywhere below this node.
@:value(new s.shortcut.signals.Signal([]))read onlydescendantRemoved:Signal<(descendant:T) ‑> Void> = new s.shortcut.signals.Signal([])
Fired when any descendant is removed anywhere below this node.
parent:T
Parent node or null if this node is detached.
Assigning this field re-parents the node. Most code should use
setParent, removeParent,
addChild, or removeChild
instead of mutating internal storage directly.
@:value(new s.shortcut.signals.Signal([]))read onlyparentChanged:Signal<(previous:T) ‑> Void> = new s.shortcut.signals.Signal([])
Fired when the parent changes.
tag:String
Optional application-defined tag used for lookup.
Tags are not required to be unique. Methods such as
getChild, getChildren, and
findChild use this field for simple structural
queries.
Inherited Methods
Defined by Object2D
Defined by Object
addChild(value:T):T
Adds a direct child.
If the child already belongs to another parent, it is re-parented.
Parameters:
value | Child node to add. |
|---|
Returns:
The added child or null if it is already present.
findChild(tag:String):T
Searches the full descendant tree for the first node with the given tag.
Search order is depth-first in child order.
Parameters:
tag | Tag to match. |
|---|
Returns:
The found descendant or null.
getChild(tag:String):T
Returns the first direct child with the given tag.
This only checks direct children and does not recurse into descendants.
Parameters:
tag | Tag to match. |
|---|
Returns:
The found child or null.
getChildren(tag:String):Array<T>
Returns all direct children with the given tag.
This only checks direct children and does not recurse into descendants.
Parameters:
tag | Tag to match. |
|---|
Returns:
Matching direct children.
removeChild(value:T):Bool
Removes a direct child.
Parameters:
value | Child node to remove. |
|---|
Returns:
true if the child was removed.
setParent(value:T):Void
Sets the parent node.
This is equivalent to adding the node to value.children.
Parameters:
value | New parent node. |
|---|
traverse(f:T ‑> Void):T
Traverses all descendants depth-first and applies a callback.
The callback receives each descendant, not the root node itself.
Parameters:
f | Callback invoked for each descendant. |
|---|
Returns:
This node.