Added optional "pixel perfect" input checks and tested against static sprites, animated sprites, physics sprites and sprites positioned outside the screen (needing camera shift to appear).

This commit is contained in:
Richard Davey
2013-09-11 16:25:46 +01:00
parent f260108433
commit fba731e740
12 changed files with 605 additions and 91 deletions
+18 -18
View File
@@ -23,6 +23,24 @@ Phaser.Sprite = function (game, x, y, key, frame) {
// The lifespan is decremented by game.time.elapsed each update, once it reaches zero the kill() function is called.
this.lifespan = 0;
/**
* The Signals you can subscribe to that are dispatched when certain things happen on this Sprite or its components
* @type Events
*/
this.events = new Phaser.Events(this);
/**
* This manages animations of the sprite. You can modify animations through it. (see AnimationManager)
* @type AnimationManager
*/
this.animations = new Phaser.AnimationManager(this);
/**
* The Input Handler Component
* @type InputHandler
*/
this.input = new Phaser.InputHandler(this);
this.key = key;
if (key instanceof Phaser.RenderTexture)
@@ -62,24 +80,6 @@ Phaser.Sprite = function (game, x, y, key, frame) {
}
}
/**
* The Signals you can subscribe to that are dispatched when certain things happen on this Sprite or its components
* @type Events
*/
this.events = new Phaser.Events(this);
/**
* This manages animations of the sprite. You can modify animations through it. (see AnimationManager)
* @type AnimationManager
*/
this.animations = new Phaser.AnimationManager(this);
/**
* The Input Handler Component
* @type InputHandler
*/
this.input = new Phaser.InputHandler(this);
/**
* The anchor sets the origin point of the texture.
* The default is 0,0 this means the textures origin is the top left