v0.3.0: added sprite emitter functionality to item sprites in all cases
This commit is contained in:
@@ -160,6 +160,7 @@ public class ItemSprite extends MovieClip {
|
||||
}
|
||||
|
||||
public ItemSprite view(Item item){
|
||||
view(item.image(), item.glowing());
|
||||
if (this.emitter != null) this.emitter.on = false;
|
||||
Emitter emitter = item.emitter();
|
||||
if (emitter != null && parent != null) {
|
||||
@@ -167,10 +168,12 @@ public class ItemSprite extends MovieClip {
|
||||
parent.add( emitter );
|
||||
this.emitter = emitter;
|
||||
}
|
||||
return view(item.image(), item.glowing());
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemSprite view( int image, Glowing glowing ) {
|
||||
if (this.emitter != null) this.emitter.on = false;
|
||||
emitter = null;
|
||||
frame( film.get( image ) );
|
||||
if ((this.glowing = glowing) == null) {
|
||||
resetColor();
|
||||
@@ -178,6 +181,12 @@ public class ItemSprite extends MovieClip {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kill() {
|
||||
super.kill();
|
||||
if (emitter != null) emitter.on = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
Reference in New Issue
Block a user