Set up custom graphics to be copied from old spritesheets when possible as well.
This commit is contained in:
parent
fb30f07f2e
commit
358b36c1bf
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Reference in a new issue