项目里需要用到,但是不是用在新手引导上,下面的代码可以绘制一个圆的四分之一,用四个即可拼出一个圆。

 1 private createShape(): egret.Shape {
 2     let magicNum = 1 - 0.55228475;
 3     let radius = 100;
 4     let shape = new egret.Shape();
 5     shape.graphics.begin();
 6     shape.graphics.lineTo(radius, 0);
 7     shape.graphics.cubicCurveTo(magicNum * radius, 0, 0, magicNum * radius, 0, radius);
 8     shape.graphics.lineTo(0, 0);
 9     shape.graphics.endFill();
10     return shape;
11 }

和绘制扇形不一样,扇形是填充圆内部,这个是填充外部。

相关文章:

  • 2021-07-22
  • 2021-05-28
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
  • 2021-11-07
猜你喜欢
  • 2022-12-23
  • 2021-10-16
  • 2021-12-31
  • 2021-08-14
  • 2021-10-23
  • 2021-11-09
  • 2022-12-23
相关资源
相似解决方案