StageObject class final

Runtime scene object made from small reusable components.

Constructors

StageObject(String name, {TransformComponent? transform})
Creates a scene object with a stable name.
StageObject.node(String name, {PhysicsTransform? transform, Iterable<StageComponent> components = const []})
Creates a scene object and attaches components immediately.
factory

Properties

components List<StageComponent>
All components attached to this object.
no setter
hashCode int
The hash code for this object.
no setterinherited
name String
Human-readable object name useful for debugging and scene queries.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transform TransformComponent
Required transform shared by render and physics components.
final

Methods

add<T extends StageComponent>(T component) → T
Adds component to this object.
dispose() → void
Detaches all components.
get<T extends StageComponent>() → T?
Returns the first component assignable to T, or null.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(StageComponent component) bool
Removes component from this object.
toString() String
A string representation of this object.
inherited
update(double deltaSeconds) → void
Updates all components in insertion order.

Operators

operator ==(Object other) bool
The equality operator.
inherited