Made the placeholder color and shape different for each layer.
This commit is contained in:
parent
8234db333e
commit
6d595705f2
1 changed files with 17 additions and 4 deletions
|
@ -304,10 +304,23 @@ module.exports = LayerAdapter = class LayerAdapter extends CocoClass
|
||||||
# and different colors for different layers.
|
# and different colors for different layers.
|
||||||
g = new createjs.Graphics()
|
g = new createjs.Graphics()
|
||||||
g.setStrokeStyle(5)
|
g.setStrokeStyle(5)
|
||||||
g.beginStroke(createjs.Graphics.getRGB(64,64,64))
|
color = {
|
||||||
g.beginFill(createjs.Graphics.getRGB(64,64,64,0.7))
|
'Land': [0, 50, 0]
|
||||||
radius = @resolutionFactor * SPRITE_PLACEHOLDER_WIDTH / 2
|
'Ground': [230, 230, 230]
|
||||||
g.drawCircle(radius, radius, radius)
|
'Obstacle': [20, 70, 20]
|
||||||
|
'Path': [200, 100, 200]
|
||||||
|
'Default': [64, 64, 64]
|
||||||
|
'Floating': [100, 100, 200]
|
||||||
|
}[@name] or [0, 0, 0]
|
||||||
|
g.beginStroke(createjs.Graphics.getRGB(color...))
|
||||||
|
color.push 0.7
|
||||||
|
g.beginFill(createjs.Graphics.getRGB(color...))
|
||||||
|
width = @resolutionFactor * SPRITE_PLACEHOLDER_WIDTH
|
||||||
|
bounds = [0, 0, width, width]
|
||||||
|
if @name in ['Default', 'Ground', 'Floating', 'Path']
|
||||||
|
g.drawEllipse(bounds...)
|
||||||
|
else
|
||||||
|
g.drawRect(bounds...)
|
||||||
new createjs.Shape(g)
|
new createjs.Shape(g)
|
||||||
|
|
||||||
#- Rendering containers for segmented thang types
|
#- Rendering containers for segmented thang types
|
||||||
|
|
Reference in a new issue