mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 07:04:31 +00:00
Added resetCursor boolean to disableInteractive and removeInteractive methods
This commit is contained in:
parent
0bffd9e087
commit
5b972ae38a
1 changed files with 16 additions and 3 deletions
|
@ -502,12 +502,16 @@ var GameObject = new Class({
|
|||
*
|
||||
* @method Phaser.GameObjects.GameObject#disableInteractive
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @param {boolean} [resetCursor=false] - Should the currently active Input cursor, if any, be reset to the default cursor?
|
||||
*
|
||||
* @return {this} This GameObject.
|
||||
*/
|
||||
disableInteractive: function ()
|
||||
disableInteractive: function (resetCursor)
|
||||
{
|
||||
this.scene.sys.input.disable(this);
|
||||
if (resetCursor === undefined) { resetCursor = false; }
|
||||
|
||||
this.scene.sys.input.disable(this, resetCursor);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
@ -534,13 +538,22 @@ var GameObject = new Class({
|
|||
*
|
||||
* @method Phaser.GameObjects.GameObject#removeInteractive
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @param {boolean} [resetCursor=false] - Should the currently active Input cursor, if any, be reset to the default cursor?
|
||||
*
|
||||
* @return {this} This GameObject.
|
||||
*/
|
||||
removeInteractive: function ()
|
||||
removeInteractive: function (resetCursor)
|
||||
{
|
||||
if (resetCursor === undefined) { resetCursor = false; }
|
||||
|
||||
this.scene.sys.input.clear(this);
|
||||
|
||||
if (resetCursor)
|
||||
{
|
||||
this.scene.sys.input.resetCursor();
|
||||
}
|
||||
|
||||
this.input = undefined;
|
||||
|
||||
return this;
|
||||
|
|
Loading…
Reference in a new issue