egret 画圆弧 圆环
参考文献
http://edn.egret.com/cn/index.php/article/index/id/674
以下函数可以供egret测试
[pcsh lang="js" tab_size="4" message="" hl_lines="" provider="manual"]
protected startCreateScene(): void {
var shape = new egret.Shape();
var angle = 20
var r = 100;
var x = 100;
var y = 100;
function changeGraphics(angle) {
shape.graphics.clear();
shape.graphics.beginFill(0x00ffff,1);
shape.graphics.lineTo(x+r,y+0);
shape.graphics.drawArc(x,y,r,0,angle * Math.PI / 180,false);
shape.graphics.lineTo(x+0,y+0);
shape.graphics.endFill();
}
changeGraphics(angle);
this.stage.addChild(shape);
shape.touchEnabled = true;
shape.addEventListener(egret.TouchEvent.TOUCH_TAP,function() {
angle += 10;
changeGraphics(angle);
},this)
}
[/pcsh]
最后更新于 2017-03-17 15:58:08 并被添加「」标签,已有 676 位童鞋阅读过。
此处评论已关闭