mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-25 08:38:09 -05:00
15 lines
480 B
CoffeeScript
15 lines
480 B
CoffeeScript
WIDTH = 20
|
|
HEIGHT = 2
|
|
EDGE = 0.3
|
|
|
|
module.exports.createProgressBar = createProgressBar = (color) ->
|
|
g = new createjs.Graphics()
|
|
g.setStrokeStyle(1)
|
|
g.beginFill(createjs.Graphics.getRGB(0, 0, 0))
|
|
g.drawRect(0, -HEIGHT/2, WIDTH, HEIGHT, HEIGHT)
|
|
g.beginFill(createjs.Graphics.getRGB(color...))
|
|
g.drawRoundRect(EDGE, EDGE - HEIGHT/2, WIDTH-EDGE*2, HEIGHT-EDGE*2, HEIGHT-EDGE*2)
|
|
s = new createjs.Shape(g)
|
|
s.z = 100
|
|
s.bounds = [0, -HEIGHT/2, WIDTH, HEIGHT]
|
|
return s
|