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
可以把节点扩展到边界方框处.如果为节点设置了纹理, 那么纹理图会和边界框的角对应起来平铺.
饼状图节点同样可以控制 size, pivot, color 之类的属性. 此外还有饼状图特定属性:
local pienode = gui.get_node("my_pie_node")
-- get the outer bounds
local fill_angle = gui.get_fill_angle(pienode)
-- increase perimeter vertices
local vertices = gui.get_perimeter_vertices(pienode)
gui.set_perimeter_vertices(pienode, vertices + 1)
-- change outer bounds
gui.set_outer_bounds(pienode, gui.PIEBOUNDS_RECTANGLE)
-- animate the inner radius
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