Normalized the container renderStrategy resolution so that both renderStrategies are the same.

This commit is contained in:
Scott Erickson 2014-09-18 13:18:44 -07:00
parent 7fb261f577
commit cc76458942
3 changed files with 3 additions and 3 deletions

View file

@ -10,7 +10,7 @@ CocoView = require 'views/kinds/CocoView'
marked.setOptions {gfm: true, sanitize: true, smartLists: true, breaks: false}
# TODO, add C-style macro constants like this?
window.SPRITE_RESOLUTION_FACTOR = 1.5
window.SPRITE_RESOLUTION_FACTOR = 3
# Prevent Ctrl/Cmd + [ / ], P, S
ctrlDefaultPrevented = [219, 221, 80, 83]

View file

@ -179,7 +179,7 @@ module.exports = class WebGLLayer extends CocoClass
for containerGlobalName in _.keys(containersToRender)
containerKey = @renderGroupingKey(thangType, containerGlobalName, colorConfig)
container = spriteBuilder.buildContainerFromStore(containerGlobalName)
frame = spriteSheetBuilder.addFrame(container, null, @resolutionFactor)
frame = spriteSheetBuilder.addFrame(container, null, @resolutionFactor * (thangType.get('scale') or 1))
spriteSheetBuilder.addAnimation(containerKey, [frame], false)
getContainersForAnimation: (thangType, animation) ->

View file

@ -147,7 +147,7 @@ module.exports = class WebGLSprite extends createjs.SpriteContainer
for localContainer in localContainers
outerContainer = new createjs.SpriteContainer(@spriteSheet)
innerContainer = new createjs.Sprite(@spriteSheet)
innerContainer.scaleX = innerContainer.scaleY = 1 / @resolutionFactor
innerContainer.scaleX = innerContainer.scaleY = 1 / (@resolutionFactor * (@thangType.get('scale') or 1))
animationName = @spriteSheetPrefix + localContainer.gn
return false if not (animationName in @spriteSheet.getAnimations())
innerContainer.gotoAndStop(animationName)