Game Development Reference
In-Depth Information
//CIRCLE
var circle = new createjs.Shape();
circle.graphics.beginStroke('#000');
circle.graphics.beginFill('#FFF000');
circle.graphics.drawCircle(0, 0, 50);
circle.x = 250;
circle.y = 70;
stage.addChild(circle);
//STAR
var poly = new createjs.Shape();
poly.graphics.beginStroke('#000');
poly.graphics.beginFill('#90ABC2');
poly.graphics.drawPolyStar(0, 0, 60, 6, 0.6);
poly.x = 400;
poly.y = 70;
stage.addChild(poly);
//TRIANGLE
var tri = new createjs.Shape();
tri.graphics.beginStroke('#000');
tri.graphics.beginFill('#00FF00');
tri.graphics.moveTo(50, 0)
.lineTo(0, 100)
.lineTo(100, 100)
.lineTo(50, 0);
tri.x = 20;
tri.y = 150;
stage.addChild(tri);
//ROUNDED RECTANGLE
var roundedRectangle = new createjs.Shape();
roundedRectangle.graphics.beginStroke('#000');
roundedRectangle.graphics.beginFill('#F7D0D1');
roundedRectangle.graphics.drawRoundRect(0,0,400,100,10);
roundedRectangle.x = roundedRectangle.y = 150;
stage.addChild(roundedRectangle);
stage.update();
 
Search WWH ::




Custom Search