Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从 AS3 创建圆润且美观的“OK”和“CANCEL”按钮?
我不想为这些使用任何图像,只是绘制它们?
我会使用 Shape 或 Sprite,并使用类似的图形属性在其上绘制
var s:Shape = new Shape(); s.graphics.beginFill(0x123123, 1); s.graphics.drawRoundRect(...); s.graphics.endFill();
或者如果您想在其上附加其他元素(如标签),请使用 Sprite
根据monkeye的回答,如果使用Flex ,您可以通过设置样式来创建非常简单的圆形按钮。cornerRadius
cornerRadius
有很多方法可以做到这一点。
如果我是你——如果你只需要一个按钮。让自己成为一个按钮类。如果您需要更多布局和 GUI 元素,请考虑使用Flex 框架或类似ASwing
在 Flex 中,要么学习如何为组件蒙皮,要么自己动手。只需创建一个画布、框、标签或其中包含图片的任何东西,并使其表现得像一个按钮。