mirror of
https://github.com/wassname/phaser.git
synced 2026-07-12 00:50:45 +08:00
* Fixed issue in Sound.play where if you gave a missing marker it would play the whole sound sprite instead.
* Button.setFrames will set the current frame based on the button state immediately. * InputHandler now creates the _pointerData array on creation and populates with one empty set of values, so pointerOver etc all work before a start call. * Added Canvas.setUserSelect() to disable touchCallouts and user selections within the canvas. * When the game boots it will now by default disable user-select and touch action events on the game canvas. * Loaded.setPreloadSprite now rounds the width/height values and starts from 1. This fixes canvas draw errors in IE9/10 and Firefox.
This commit is contained in:
@@ -68,6 +68,24 @@ Phaser.InputHandler = function (sprite) {
|
||||
|
||||
this._tempPoint = new Phaser.Point;
|
||||
|
||||
this._pointerData = [];
|
||||
|
||||
this._pointerData.push({
|
||||
id: 0,
|
||||
x: 0,
|
||||
y: 0,
|
||||
isDown: false,
|
||||
isUp: false,
|
||||
isOver: false,
|
||||
isOut: false,
|
||||
timeOver: 0,
|
||||
timeOut: 0,
|
||||
timeDown: 0,
|
||||
timeUp: 0,
|
||||
downDuration: 0,
|
||||
isDragged: false
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
Phaser.InputHandler.prototype = {
|
||||
@@ -84,11 +102,10 @@ Phaser.InputHandler.prototype = {
|
||||
this.game.input.interactiveItems.add(this);
|
||||
this.useHandCursor = useHandCursor;
|
||||
this.priorityID = priority;
|
||||
this._pointerData = [];
|
||||
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
this._pointerData.push({
|
||||
this._pointerData[i] = {
|
||||
id: i,
|
||||
x: 0,
|
||||
y: 0,
|
||||
@@ -102,7 +119,7 @@ Phaser.InputHandler.prototype = {
|
||||
timeUp: 0,
|
||||
downDuration: 0,
|
||||
isDragged: false
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
this.snapOffset = new Phaser.Point;
|
||||
@@ -350,10 +367,8 @@ Phaser.InputHandler.prototype = {
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
},
|
||||
|
||||
@@ -388,7 +403,7 @@ Phaser.InputHandler.prototype = {
|
||||
*/
|
||||
update: function (pointer) {
|
||||
|
||||
if (this.enabled == false || this.sprite.visible == false)
|
||||
if (this.enabled == false || this.sprite.visible == false || (this.sprite.group && this.sprite.group.visible == false))
|
||||
{
|
||||
this._pointerOutHandler(pointer);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user