Phaser API Documentation

  Version: 
pointerConstraint([options])

Description:

A Pointer Constraint is a special type of constraint that allows you to click and drag bodies in a Matter World. It monitors the active Pointers in a Scene, and when one is pressed down it checks to see if that hit any part of any active body in the world. If it did, and the body has input enabled, it will begin to drag it until either released, or you stop it via the stopDrag method.

You can adjust the stiffness, length and other properties of the constraint via the options object on creation.

Parameters:

name type arguments description
options Phaser.Types.Physics.Matter.MatterConstraintConfig <optional>

An optional Constraint configuration object that is used to set initial Constraint properties on creation.

Returns:
Description:

A Matter JS Constraint.

Type:
  • MatterJS.ConstraintType
Since: 3.0.0