Phaser API Documentation

  Version: 
setDraggable(gameObjects, [value])

Description:

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.

Parameters:

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.

Returns:
Description:

This InputPlugin object.

Examples:
Since: 3.0.0