2014-09-24 19:53:38 -04:00
|
|
|
WIDTH = 20
|
|
|
|
HEIGHT = 2
|
|
|
|
EDGE = 0.3
|
2014-01-03 13:32:13 -05:00
|
|
|
|
2014-09-24 19:53:38 -04:00
|
|
|
module.exports.createProgressBar = createProgressBar = (color) ->
|
2014-01-03 13:32:13 -05:00
|
|
|
g = new createjs.Graphics()
|
|
|
|
g.setStrokeStyle(1)
|
2014-03-07 20:37:11 -05:00
|
|
|
g.beginFill(createjs.Graphics.getRGB(0, 0, 0))
|
2014-09-24 19:53:38 -04:00
|
|
|
g.drawRect(0, -HEIGHT/2, WIDTH, HEIGHT, HEIGHT)
|
2014-01-03 13:32:13 -05:00
|
|
|
g.beginFill(createjs.Graphics.getRGB(color...))
|
2014-09-24 19:53:38 -04:00
|
|
|
g.drawRoundRect(EDGE, EDGE - HEIGHT/2, WIDTH-EDGE*2, HEIGHT-EDGE*2, HEIGHT-EDGE*2)
|
2014-01-03 13:32:13 -05:00
|
|
|
s = new createjs.Shape(g)
|
|
|
|
s.z = 100
|
2014-09-24 19:53:38 -04:00
|
|
|
s.bounds = [0, -HEIGHT/2, WIDTH, HEIGHT]
|
2014-01-03 13:32:13 -05:00
|
|
|
return s
|