lcg #005:2

CreateJS -draw shapes

by dirkk0

HTML

<canvas id="canvas" width="300" height="300"></canvas>

JavaScript

var stage = new createjs.Stage("canvas");

var c = new createjs.Graphics().f("#f00").drawCircle(0, 0, 60)

var r = new createjs.Graphics().f("#ff0").rect(100,0, 80, 80);

var s1 = new createjs.Shape(r);

var s2 = new createjs.Shape(c).set({
    x: 100,
    y: 100
});

stage.addChild(s2);
stage.addChild(s1);
stage.update();