ConstraintPositionToNode constructor

ConstraintPositionToNode({
  1. required Node targetNode,
  2. double? dampening,
  3. 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.

Implementation

ConstraintPositionToNode({
  required this.targetNode,
  this.dampening,
  this.offset = Offset.zero,
});