Phaser API Documentation

setDraggable(gameObjects, [value])


Sets the draggable state of the given array of Game Objects.

They can either be set to be draggable, or can have their draggable state removed by passing false.

A Game Object will not fire drag events unless it has been specifically enabled for drag.


name type arguments Default description
gameObjects Phaser.GameObjects.GameObject | Array.<Phaser.GameObjects.GameObject>

An array of Game Objects to change the draggable state on.

value boolean <optional> true

Set to true if the Game Objects should be made draggable, false if they should be unset.


This InputPlugin object.

Since: 3.0.0