This translation is community contributed and may not be up to date. We only maintain the English version of the documentation. Read this manual in English
饼状图节点用于创建圆形或椭圆形对象,范围从普通圆形到饼形和方形甜甜圈形状。
在Outline中的Nodes部分右键点击并选择Add ▸ Pie。新的饼状图节点被选中,您可以修改其属性。
以下属性是饼状图节点特有的:
Ellipse
将节点扩展到外半径。Rectangle
将节点扩展到节点的边界框。如果在节点上设置了纹理,纹理图像将平展地应用,纹理的角与节点边界框的角相对应。
饼状图节点响应任何通用的节点操作函数,用于设置大小、轴心、颜色等。还存在一些仅适用于饼状图节点的函数和属性:
local pienode = gui.get_node("my_pie_node")
-- 获取外边界
local fill_angle = gui.get_fill_angle(pienode)
-- 增加周长顶点
local vertices = gui.get_perimeter_vertices(pienode)
gui.set_perimeter_vertices(pienode, vertices + 1)
-- 更改外边界
gui.set_outer_bounds(pienode, gui.PIEBOUNDS_RECTANGLE)
-- 动画内半径
gui.animate(pienode, "inner_radius", 100, gui.EASING_INOUTSINE, 2, 0, nil, gui.PLAYBACK_LOOP_PINGPONG)
Did you spot an error or do you have a suggestion? Please let us know on GitHub!
GITHUB