核心代码:
var shape;
var animationProps = {width: 50,height: 50,cornerRadius: 0,color: "#00FF00"
};
function init() { shape = new createjs.Shape();shape.x = 200;shape.y = 150;stage.addChild(shape);// 初始绘制updateShape();// 设置补间动画createTween();// 启动动画循环createjs.Ticker.framerate = 60;createjs.Ticker.addEventListener("tick", updateStage);
}
function updateStage()
{}
function updateShape() {shape.graphics.clear() // 清除旧图形.beginFill(animationProps.color).drawRoundRect(0, // x0, // yanimationProps.width,animationProps.height,animationProps.cornerRadius);
}function createTween() {createjs.Tween.get(animationProps, {loop: true}).to({width: