mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 07:01:20 +00:00
Fix checkPointerDown method
checkPointerDown method was a verbatim duplication of checkPointerOver - added pointer.isDown check to passed pointer and altered wording of associated docs to make it clearer what the method is doing.
This commit is contained in:
parent
8436bfe3e1
commit
187387126d
1 changed files with 2 additions and 2 deletions
|
@ -610,14 +610,14 @@ Phaser.InputHandler.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the given pointer is over this Sprite and can click it.
|
* Checks if the given pointer is both down and over this Sprite.
|
||||||
* @method Phaser.InputHandler#checkPointerDown
|
* @method Phaser.InputHandler#checkPointerDown
|
||||||
* @param {Phaser.Pointer} pointer
|
* @param {Phaser.Pointer} pointer
|
||||||
* @return {boolean} True if the pointer is down, otherwise false.
|
* @return {boolean} True if the pointer is down, otherwise false.
|
||||||
*/
|
*/
|
||||||
checkPointerDown: function (pointer) {
|
checkPointerDown: function (pointer) {
|
||||||
|
|
||||||
if (!this.enabled || !this.sprite || !this.sprite.parent || !this.sprite.visible || !this.sprite.parent.visible)
|
if (!pointer.isDown || !this.enabled || !this.sprite || !this.sprite.parent || !this.sprite.visible || !this.sprite.parent.visible)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue