Godot Engine 3.2 Alpha2
SceneTree继承于MainLoop,注意:SceneTree本身并不是Node,它通过节点树管理游戏主循环。
常用属性
| 类型 | 属性名 | 说明 |
|---|---|---|
| Node | current_scene | 当前场景 |
| bool | debug_collisions_hint | |
| bool | debug_navigation_hint | |
| Node | edited_scene_root | |
| MultiplayerAPI | multiplayer | |
| bool | multiplayer_poll | |
| NetworkedMultiplayerPeer | network_peer | |
| bool | paused | 主循环开关,即控制2D/3D物理系统以及_process/_physics_process/_input的开关 |
| bool | refuse_new_network_connections | |
| Viewport | root | Viewport类型,它是场景树的根视口,并且它本身就是一个只读属性 |
| bool | use_font_oversampling |
常用方法
| 类型 | 方法名 | 说明 |
|---|---|---|
| Variant | call_group ( String group, String method, … ) vararg | |
| Variant | call_group_flags ( int flags, String group, String method, … ) vararg | |
| Error | change_scene ( String path ) | 跳转Scene,参数为path |
| Error | change_scene_to ( PackedScene packed_scene ) | 跳转Scene,参数为场景资源 |
| SceneTreeTimer | create_timer ( float time_sec, bool pause_mode_process=true ) | |
| int | get_frame ( ) const | |
| PoolIntArray | get_network_connected_peers ( ) const | |
| int | get_network_unique_id ( ) const | |
| int | get_node_count ( ) const | |
| Array | get_nodes_in_group ( String group ) | |
| int | get_rpc_sender_id ( ) const | |
| bool | has_group ( String name ) const | |
| bool | has_network_peer ( ) const | |
| bool | is_input_handled ( ) | |
| bool | is_network_server ( ) const | |
| void | notify_group ( String group, int notification ) | |
| void | notify_group_flags ( int call_flags, String group, int notification ) | |
| void | queue_delete ( Object obj ) | |
| void | quit ( ) | 退出程序 |
| Error | reload_current_scene ( ) | |
| void | set_auto_accept_quit ( bool enabled ) | |
| void | set_group ( String group, String property, Variant value ) | |
| void | set_group_flags ( int call_flags, String group, String property, Variant value ) | |
| void | set_input_as_handled ( ) | |
| void | set_quit_on_go_back ( bool enabled ) | |
| void | set_screen_stretch ( StretchMode mode, StretchAspect aspect, Vector2 minsize, float shrink=1 ) |
