Loads of issues reported on Github resolved (sprite crop, music resume, etc).

This commit is contained in:
photonstorm
2013-10-24 04:27:28 +01:00
parent e4621aafdd
commit a6fac64248
17 changed files with 538 additions and 774 deletions
+13 -22
View File
@@ -395,6 +395,19 @@ Phaser.Input.prototype = {
this.mspointer.start();
this.mousePointer.active = true;
},
/**
* Stops all of the Input Managers from running.
* @method Phaser.Input#destroy
*/
destroy: function () {
this.mouse.stop();
this.keyboard.stop();
this.touch.stop();
this.mspointer.stop();
},
/**
@@ -681,28 +694,6 @@ Phaser.Input.prototype = {
return null;
},
/**
* Get the distance between two Pointer objects.
* @method Phaser.Input#getDistance
* @param {Pointer} pointer1
* @param {Pointer} pointer2
* @return {Description} Description.
*/
getDistance: function (pointer1, pointer2) {
// return Phaser.Vec2Utils.distance(pointer1.position, pointer2.position);
},
/**
* Get the angle between two Pointer objects.
* @method Phaser.Input#getAngle
* @param {Pointer} pointer1
* @param {Pointer} pointer2
* @return {Description} Description.
*/
getAngle: function (pointer1, pointer2) {
// return Phaser.Vec2Utils.angle(pointer1.position, pointer2.position);
}
};
+9 -3
View File
@@ -306,10 +306,13 @@ Phaser.InputHandler.prototype = {
if (this.enabled)
{
this.enabled = false;
this.game.input.interactiveItems.remove(this);
this.stop();
// Null everything
this.sprite = null;
// etc
}
},
@@ -615,7 +618,10 @@ Phaser.InputHandler.prototype = {
this.game.stage.canvas.style.cursor = "default";
}
this.sprite.events.onInputOut.dispatch(this.sprite, pointer);
if (this.sprite && this.sprite.events)
{
this.sprite.events.onInputOut.dispatch(this.sprite, pointer);
}
},
+2 -2
View File
@@ -281,7 +281,7 @@ Phaser.Pointer.prototype = {
this.game.input.x = this.x * this.game.input.scale.x;
this.game.input.y = this.y * this.game.input.scale.y;
this.game.input.position.setTo(this.x, this.y);
this.game.input.onDown.dispatch(this);
this.game.input.onDown.dispatch(this, event);
this.game.input.resetSpeed(this.x, this.y);
}
@@ -506,7 +506,7 @@ Phaser.Pointer.prototype = {
if (this.game.input.multiInputOverride == Phaser.Input.MOUSE_OVERRIDES_TOUCH || this.game.input.multiInputOverride == Phaser.Input.MOUSE_TOUCH_COMBINE || (this.game.input.multiInputOverride == Phaser.Input.TOUCH_OVERRIDES_MOUSE && this.game.input.currentPointers == 0))
{
this.game.input.onUp.dispatch(this);
this.game.input.onUp.dispatch(this, event);
// Was it a tap?
if (this.duration >= 0 && this.duration <= this.game.input.tapRate)