代码1:
- var myG=new createjs.Graphics();
- myG.beginFill("#ff0000");
- myG.beginStroke("0000ff");
- myG.drawCircle(100,100,50);
- myG.drawRect(200,200,100,50);
- myG.drawEllipse(400,400,100,50);
- myG.moveTo(100,100);
- myG.lineTo(200,200);
- var myS=new createjs.Shape(myG);
- myS.shadow=new createjs.Shadow("grey",10,10,20);
- stage.addChild(myS);
- var myT=new createjs.Text("航天技师","bold 36px 黑体","#00ff00");
- myT.x=400;
- myT.y=500;
- myT.shadow=new createjs.Shadow("grey",10,10,20);
- stage.addChild(myT)
代码2:
- var myG=new createjs.Graphics();
- myG.beginFill("#ff0000");
- myG.beginStroke("0000ff");
- myG.drawCircle(0,0,50);
- var myS=new createjs.Shape(myG);
- stage.addChild(myS);
- createjs.Tween.get(myS,{loop:true}).to({x:500,y:500},2000,createjs.Ease.bounceOut).call(tip);
- function tip()
- {
- console.log("ccc");
- }