Made paths more visible, because I couldn't see them.

This commit is contained in:
Nick Winter 2014-11-18 18:13:59 -08:00
parent e93de815c2
commit 666334b28c

View file

@ -1,7 +1,7 @@
PAST_PATH_ALPHA = 0.75
PAST_PATH_WIDTH = 5
FUTURE_PATH_ALPHA = 0.4
FUTURE_PATH_WIDTH = 2
FUTURE_PATH_ALPHA = 0.75
FUTURE_PATH_WIDTH = 4
TARGET_ALPHA = 1
TARGET_WIDTH = 10
FUTURE_PATH_INTERVAL_DIVISOR = 4
@ -38,17 +38,18 @@ module.exports = class TrailMaster extends CocoClass
@tweens = []
createGraphics: ->
@targetDotKey = @cachePathDot(TARGET_WIDTH, @colorForThang(@thang.team, TARGET_ALPHA))
@pastDotKey = @cachePathDot(PAST_PATH_WIDTH, @colorForThang(@thang.team, PAST_PATH_ALPHA))
@futureDotKey = @cachePathDot(FUTURE_PATH_WIDTH, @colorForThang(@thang.team, FUTURE_PATH_ALPHA))
@targetDotKey = @cachePathDot(TARGET_WIDTH, @colorForThang(@thang.team, TARGET_ALPHA), [0, 0, 0, 1])
@pastDotKey = @cachePathDot(PAST_PATH_WIDTH, @colorForThang(@thang.team, PAST_PATH_ALPHA), [0, 0, 0, 1])
@futureDotKey = @cachePathDot(FUTURE_PATH_WIDTH, [255, 255, 255, FUTURE_PATH_ALPHA], @colorForThang(@thang.team, 1))
cachePathDot: (width, color) ->
key = "path-dot-#{width}-#{color}"
color = createjs.Graphics.getRGB(color...)
cachePathDot: (width, fillColor, strokeColor) ->
key = "path-dot-#{width}-#{fillColor}-#{strokeColor}"
fillColor = createjs.Graphics.getRGB(fillColor...)
strokeColor = createjs.Graphics.getRGB(strokeColor...)
unless key in @layerAdapter.spriteSheet.getAnimations()
circle = new createjs.Shape()
radius = width/2
circle.graphics.setStrokeStyle(width/5).beginFill(color).beginStroke('#000000').drawCircle(0, 0, radius)
circle.graphics.setStrokeStyle(width/5).beginFill(fillColor).beginStroke(strokeColor).drawCircle(0, 0, radius)
@layerAdapter.addCustomGraphic(key, circle, [-radius*1.5, -radius*1.5, radius*3, radius*3])
return key