Getting started - Introduction - Installing Defold - The editor - Glossary - Defold for Flash users - Getting help Project setup - Creating a project - Project settings - Libraries Core concepts - Building blocks - Addressing - Message passing - Application lifecycle Assets and resources - Importing assets - Importing 2D graphics - Importing 3D models - Adapting to different screen sizes - Live update - Animation - Atlas - Font - Resource management - Tile source - Texture filtering - Texture profiles Components - Overview - Collection factory - Collection proxy - Collision object - Camera - Factory - Label - Mesh - Model - Particle FX - Sound - Spine animation - Spine model - Sprite - Tilemap Gui - GUI overview - Box nodes - Text nodes - Pie nodes - Spine nodes - ParticleFX nodes - Template nodes - Scripts - Clipping - Layouts Physics - Physics overview - Collision objects - Collision shapes - Collision groups - Collision messages - Resolving collisions - Ray casts - Joints and constraints Game logic - Scripts - Properties - Script properties - Lua in Defold - Input - Modules - Debugging Saving and loading files - Working with files Networking - Overview - HTTP Requests - Socket connections - WebSocket connections - Online services Rendering - Render - Material - Shader - Texture filtering Workflow - Adapting to different screen sizes - Bundling an application - Bob the builder - Hot reloading - Optimizing an application - Profiling - Refactoring - The mobile dev app - Version control - Writing code - Working offline Debugging - Debugging game logic - Debugging native code - Debugging native code on Android - Debugging native code on iOS - Reading game and system logs - Profiling Platforms - Android - iOS - Nintendo Switch - Linux - HTML5 - macOS - Windows Monetization - Ads - In-app purchases - Web Monetization Extensions - Advertising Info - Camera - Facebook - Facebook Instant Games - Firebase Analytics - Google Play Game Services - Google Play Instant - In-app purchases - Inter-app communication - Push notifications - App review and ratings - WebMonetization - WebSocket - Webview Native extensions - Introduction - Details - Defold SDK - Adding auto-complete definition - Best Practices - Debugging - Build Variants - Manifest Merging Editor extensions - Editor scripts
Read this manual in English
GUI 饼状图节点
饼状图节点用以创建圆的或者椭圆的从实心到环状的可视对象.
创建饼状图节点
右键点击 Outline 中的 Nodes 部分, 选择 Add ▸ Pie . 饼状图就创建好了.
以下属性是饼状图节点的特有属性:
Inner Radius
节点的内半径, 延X轴.
Outer Bounds
节点外轮廓.
Ellipse
可以把节点扩展到外半径处.
Rectangle
可以把节点扩展到边界方框处.
Perimeter Vertices
图形的分段数, 就是360度一圈需要的顶点数.
Pie Fill Angle
饼状图的填充. 从右侧开始按逆时针方向.
如果为节点设置了纹理, 那么纹理图会和边界框的角对应起来平铺.
运行时修改饼状图
饼状图节点同样可以控制 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 )