mirror of
https://github.com/wassname/phaser.git
synced 2026-07-15 01:11:26 +08:00
Fixed a fantastic FrameData bug. Also added support to the Emitter to handle multiple image keys and/or frames.
This commit is contained in:
@@ -91,4 +91,10 @@ Phaser.GameObjectFactory.prototype = {
|
||||
|
||||
},
|
||||
|
||||
emitter: function (x, y, maxParticles) {
|
||||
|
||||
return this.game.particles.add(new Phaser.Particles.Arcade.Emitter(this.game, x, y, maxParticles));
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
@@ -23,16 +23,13 @@ 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;
|
||||
|
||||
if (key)
|
||||
if (key == null || this.game.cache.checkImageKey(key) == false)
|
||||
{
|
||||
PIXI.Sprite.call(this, PIXI.TextureCache[key]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// No texture yet
|
||||
PIXI.Sprite.call(this);
|
||||
key = '__default';
|
||||
}
|
||||
|
||||
PIXI.Sprite.call(this, PIXI.TextureCache[key]);
|
||||
|
||||
this.events = new Phaser.Events(this);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user