Check type uses the static values

This commit is contained in:
wKLV
2013-11-04 00:16:36 +01:00
parent 4593a42a5b
commit e8bac6c8c7
+10 -2
View File
@@ -63,6 +63,11 @@ Phaser.Mouse = function (game) {
};
/**
* @constant
* @type {number}
*/
Phaser.Mouse.NO_BUTTON = -1;
/**
* @constant
* @type {number}
@@ -81,6 +86,7 @@ Phaser.Mouse.MIDDLE_BUTTON = 1;
*/
Phaser.Mouse.RIGHT_BUTTON = 2;
Phaser.Mouse.prototype = {
/**
@@ -124,7 +130,9 @@ Phaser.Mouse.prototype = {
event.preventDefault();
this.mouseTypeDown = event.which - 1;
if (event.which === 1) this.mouseTypeDown = Phaser.Mouse.LEFT_BUTTON;
else if (event.which === 2) this.mouseTypeDown = Phaser.Mouse.MIDDLE_BUTON;
else if (event.which === 3) this.mouseTypeDown = Phaser.Mouse.RIGHT_BUTTON;
if (this.mouseDownCallback)
{
@@ -176,7 +184,7 @@ Phaser.Mouse.prototype = {
event.preventDefault();
this.mouseTypeDown = -1;
this.mouseTypeDown = Phaser.Mouse.NO_BUTTON;
if (this.mouseUpCallback)
{