mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-12 08:41:46 -05:00
Render from partially-completed prerendered spritesheet correctly, fix #3641
This commit is contained in:
parent
0cef562d9b
commit
136d274d54
1 changed files with 4 additions and 1 deletions
|
@ -358,6 +358,9 @@ module.exports = LayerAdapter = class LayerAdapter extends CocoClass
|
||||||
prerenderedSpriteSheet = thangType.getPrerenderedSpriteSheet(colorConfig, 'segmented')
|
prerenderedSpriteSheet = thangType.getPrerenderedSpriteSheet(colorConfig, 'segmented')
|
||||||
if prerenderedSpriteSheet and not prerenderedSpriteSheet.loadedImage
|
if prerenderedSpriteSheet and not prerenderedSpriteSheet.loadedImage
|
||||||
return
|
return
|
||||||
|
else if prerenderedSpriteSheet
|
||||||
|
animations = prerenderedSpriteSheet.spriteSheet._animations
|
||||||
|
renderedActions = _.zipObject(animations, _.times(animations.length, -> true))
|
||||||
containersToRender = thangType.getContainersForActions(actionNames)
|
containersToRender = thangType.getContainersForActions(actionNames)
|
||||||
#console.log 'render segmented', thangType.get('name'), actionNames, colorConfig, 'because we do not have prerendered sprite sheet?', prerenderedSpriteSheet
|
#console.log 'render segmented', thangType.get('name'), actionNames, colorConfig, 'because we do not have prerendered sprite sheet?', prerenderedSpriteSheet
|
||||||
spriteBuilder = new SpriteBuilder(thangType, {colorConfig: colorConfig})
|
spriteBuilder = new SpriteBuilder(thangType, {colorConfig: colorConfig})
|
||||||
|
@ -367,7 +370,7 @@ module.exports = LayerAdapter = class LayerAdapter extends CocoClass
|
||||||
container = new createjs.Sprite(@spriteSheet)
|
container = new createjs.Sprite(@spriteSheet)
|
||||||
container.gotoAndStop(containerKey)
|
container.gotoAndStop(containerKey)
|
||||||
frame = spriteSheetBuilder.addFrame(container)
|
frame = spriteSheetBuilder.addFrame(container)
|
||||||
else if prerenderedSpriteSheet
|
else if prerenderedSpriteSheet and renderedActions[containerGlobalName]
|
||||||
container = new createjs.Sprite(prerenderedSpriteSheet.spriteSheet)
|
container = new createjs.Sprite(prerenderedSpriteSheet.spriteSheet)
|
||||||
container.gotoAndStop(containerGlobalName)
|
container.gotoAndStop(containerGlobalName)
|
||||||
scale = @resolutionFactor / (prerenderedSpriteSheet.get('resolutionFactor') or 1)
|
scale = @resolutionFactor / (prerenderedSpriteSheet.get('resolutionFactor') or 1)
|
||||||
|
|
Loading…
Reference in a new issue