Updated Loader component and fixed a few Pointer issues.

This commit is contained in:
Richard Davey
2013-06-05 02:58:16 +01:00
parent d42f396ba0
commit 2f03f5fc43
118 changed files with 934 additions and 602 deletions
+8 -13
View File
@@ -287,7 +287,7 @@ module Phaser.Components {
}
else
{
this._pointOutHandler(pointer);
this._pointerOutHandler(pointer);
return false;
}
}
@@ -316,7 +316,7 @@ module Phaser.Components {
}
public _pointOutHandler(pointer: Pointer) {
public _pointerOutHandler(pointer: Pointer) {
this._pointerData[pointer.id].isOver = false;
this._pointerData[pointer.id].isOut = true;
@@ -335,11 +335,8 @@ module Phaser.Components {
public _touchedHandler(pointer: Pointer): bool {
console.log('touched handler', this._pointerData[pointer.id]);
if (this._pointerData[pointer.id].isDown == false && this._pointerData[pointer.id].isOver == true)
{
//console.log('touchDown on', this._sprite.texture.cacheKey,this._sprite.frameName, this._sprite.frameBounds.width,this._sprite.frameBounds.height);
this._pointerData[pointer.id].isDown = true;
this._pointerData[pointer.id].isUp = false;
this._pointerData[pointer.id].timeDown = this.game.time.now;
@@ -362,8 +359,6 @@ module Phaser.Components {
public _releasedHandler(pointer: Pointer) {
console.log('release handler');
// If was previously touched by this Pointer, check if still is
if (this._pointerData[pointer.id].isDown && pointer.isUp)
{
@@ -562,7 +557,7 @@ module Phaser.Components {
this._dragPoint.setTo(this._sprite.x - pointer.x, this._sprite.y - pointer.y);
}
//pointer.draggedObject = this._sprite;
this.updateDrag(pointer);
}
@@ -678,13 +673,13 @@ module Phaser.Components {
*/
public renderDebugInfo(x: number, y: number, color?: string = 'rgb(255,255,255)') {
this._sprite.texture.context.font = '16px Courier';
this._sprite.texture.context.font = '14px Courier';
this._sprite.texture.context.fillStyle = color;
this._sprite.texture.context.fillText('Sprite Input: (' + this._sprite.frameBounds.width + ' x ' + this._sprite.frameBounds.height + ')', x, y);
this._sprite.texture.context.fillText('x: ' + this.pointerX(1).toFixed(1) + ' y: ' + this.pointerY(1).toFixed(1), x, y + 14);
this._sprite.texture.context.fillText('over: ' + this.pointerOver(1) + ' duration: ' + this.overDuration(1).toFixed(0), x, y + 28);
this._sprite.texture.context.fillText('down: ' + this.pointerDown(1) + ' duration: ' + this.downDuration(1).toFixed(0), x, y + 42);
this._sprite.texture.context.fillText('just over: ' + this.justOver(1) + ' just out: ' + this.justOut(1), x, y + 56);
this._sprite.texture.context.fillText('x: ' + this.pointerX().toFixed(1) + ' y: ' + this.pointerY().toFixed(1), x, y + 14);
this._sprite.texture.context.fillText('over: ' + this.pointerOver() + ' duration: ' + this.overDuration().toFixed(0), x, y + 28);
this._sprite.texture.context.fillText('down: ' + this.pointerDown() + ' duration: ' + this.downDuration().toFixed(0), x, y + 42);
this._sprite.texture.context.fillText('just over: ' + this.justOver() + ' just out: ' + this.justOut(), x, y + 56);
}