actionscript-3 - as3 : draw circle with a hole in it using only actionscript

标签 actionscript-3

好的,所以基本上我想在 as3 中画一个圆圈,里面有一个“洞”(就像一个 donut )。像这样的东西,但没有轮廓:

http://www.steel.ie/DugganSteel/Pictures/Hollow-circle.gif

这不起作用:

SPRITE.graphics.beginFill(0xFFFFFF);
SPRITE.graphics.drawCircle(0,0,10);
SPRITE.graphics.endFill();
SPRITE.graphics.drawCircle(0,0,5);

我的意思是这看起来很简单,但我找不到任何信息。我还应该提到,我试图只画 3/4 的圆圈,比如 3/4 的 donut 。所以我打算在原来的圆上画一个透明的圆和正方形,我知道这看起来有点奇怪,因为你希望透明的东西可以显示它下面的东西。

最佳答案

它实际上非常简单。请参阅以下代码:

var p:Point = new Point(100, 100);
graphics.beginFill(0xFF0000);
graphics.drawCircle(p.x, p.y, 100);
graphics.drawCircle(p.x, p.y, 50);

交叉路口相互抵消,直到您调用 endFill
祝你好运!

关于actionscript-3 - as3 : draw circle with a hole in it using only actionscript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3630190/

相关文章:

flash - AS3 : Check if a Dictionary is empty

actionscript-3 - 你将如何实现像 Vector.<T> 这样的泛型?

flash - 可以返回两种类型的方法的 AS3 最佳实践

android - AS3 : Drawing Lines With Touch Screens

php - 如何在 ActionScript 3 中获取关于 MySQL 时间戳的时间?

css - 你知道这个奇怪的事情吗? "AS3, Button width cannot change by setStyle(). However, inline CSS can change width."

actionscript-3 - 将 actionscript 3 项目构建为 exe

actionscript-3 - 如何在AS3(Adobe Air2.5)中录制音频并保存为mp3格式?

javascript - 如何使用 javascript 或 ActionScript 使浏览器全屏(与 F11 相同)?

flash - AS3 : Make sure children stays inside parent movieclip's shape