mirror of
https://github.com/wassname/phaser.git
synced 2026-06-28 16:20:37 +08:00
Loads of issues reported on Github resolved (sprite crop, music resume, etc).
This commit is contained in:
+13
-22
@@ -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);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user