Class: Drag

Drag

A static class to handle drag


new Drag()

Methods


<static> bindEvent(subject, eventName, callback [, context])

Binds the onDragStart, onDragUpdate and onDragEnd events on Sprites and Groups

Parameters:
Name Type Argument Description
subject Phaser.Sprite | Phaser.Group

The Sprite or Group

eventName string

The event name, one of onDragStart, onDragUpdate, onDragEnd

callback function

Callback handler

context Object <optional>

The callback context


<static> enable(subject [, clampToCenter])

Enables the drag feature on a Sprite (native) or a group (not implemented)

Parameters:
Name Type Argument Default Description
subject Phaser.Sprite | Phaser.Group

The Sprite or Group to be dragged

clampToCenter boolean <optional>
false

Clamp the item to its center while dragging