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
componentsimmediately.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
componentto this object. -
dispose(
) → void - Detaches all components.
-
get<
T extends StageComponent> () → T? -
Returns the first component assignable to
T, ornull. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
StageComponent component) → bool -
Removes
componentfrom 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