Set up custom graphics to be copied from old spritesheets when possible as well.

This commit is contained in:
Scott Erickson 2014-09-24 18:47:10 -07:00
parent fb30f07f2e
commit 358b36c1bf

View file

@ -237,8 +237,14 @@ module.exports = LayerAdapter = class LayerAdapter extends CocoClass
builder.addFrame(placeholder)
# Add custom graphics
extantGraphics = if @spriteSheet?.resolutionFactor is @resolutionFactor then @spriteSheet.getAnimations() else []
for key, graphic of @customGraphics
frame = builder.addFrame(graphic.graphic, graphic.bounds, @resolutionFactor)
if key in extantGraphics
graphic = new createjs.Sprite(@spriteSheet)
graphic.gotoAndStop(key)
frame = builder.addFrame(graphic)
else
frame = builder.addFrame(graphic.graphic, graphic.bounds, @resolutionFactor)
builder.addAnimation(key, [frame], false)
# Render ThangTypes