A Constraint that constrains the position of a node to equal the position of another node, optionally with dampening.
- Inheritance
- Object
- Constraint
- ConstraintPositionToNode
Constructors
- ConstraintPositionToNode(Node targetNode, { double dampening, Offset offset: Offset.zero })
-
Creates a new Constraint that constrains the poistion of a node to be equal to the position of the targetNode. Optionally an offset can be used and also dampening. The targetNode doesn't need to have the same parent, but they need to be added to the same SpriteBox.
Properties
- dampening → double
-
Dampening used when following the targetNode, value between 0.0 and 1.0.
read-only - hashCode → int
-
Get a hash code for this object.
read-only, inherited - offset → Offset
-
Offset to the target node.
read-only - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited - targetNode → Node
-
Target node to follow.
read-only
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
constrain(
Node node, double dt) → void -
Called after update is complete, if the constraint has been added to a
Node
. Override this method to modify the node's property according to the constraint. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
preUpdate(
Node node, double dt) → void -
Called before the node's update method is called. This method can be overridden to create setup work that needs to happen before the the node is updated, e.g. to calculate the node's speed.
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited