ConstraintPositionToNode class
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 anoffset
can be used and alsodampening
. 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.final - offset → Offset
-
Offset to the target node.
final
- targetNode → Node
-
Target node to follow.
final
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, 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
Operators
-
operator ==(
other) → bool -
The equality operator. [...]
inherited