mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 07:04:31 +00:00
The InputManager.resetCursor
method has a new optional boolean forceReset
which will reset the state of the CSS canvas cursor, regardless if there is a given Interactive Object, or not.
This commit is contained in:
parent
5b972ae38a
commit
2a05c49d9e
1 changed files with 4 additions and 3 deletions
|
@ -452,11 +452,12 @@ var InputManager = new Class({
|
|||
* @private
|
||||
* @since 3.10.0
|
||||
*
|
||||
* @param {Phaser.Types.Input.InteractiveObject} interactiveObject - The Interactive Object that called this method.
|
||||
* @param {Phaser.Types.Input.InteractiveObject} interactiveObject - The Interactive Object that called this method. Pass `null` if you just want to set the force value.
|
||||
* @param {boolean} [forceReset=false] - Should the reset happen regardless of the object's cursor state? Default false.
|
||||
*/
|
||||
resetCursor: function (interactiveObject)
|
||||
resetCursor: function (interactiveObject, forceReset)
|
||||
{
|
||||
if (interactiveObject.cursor && this.canvas)
|
||||
if ((forceReset || (interactiveObject && interactiveObject.cursor)) && this.canvas)
|
||||
{
|
||||
this.canvas.style.cursor = this.defaultCursor;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue