SceneTree

Inherits: MainLoop < Object

Category: Core

Brief Description

Member Functions

Variant call_group ( String group, String method ) vararg
Variant call_group_flags ( int flags, String group, String method ) vararg
int change_scene ( String path )
int change_scene_to ( PackedScene packed_scene )
SceneTreeTimer create_timer ( float time_sec, bool pause_mode_process=true )
Node get_current_scene ( ) const
Node get_edited_scene_root ( ) const
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 )
Viewport get_root ( ) const
int get_rpc_sender_id ( ) const
bool has_group ( String name ) const
bool has_network_peer ( ) const
bool is_debugging_collisions_hint ( ) const
bool is_debugging_navigation_hint ( ) const
bool is_input_handled ( )
bool is_network_server ( ) const
bool is_paused ( ) const
bool is_refusing_new_network_connections ( ) 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 ( )
int reload_current_scene ( )
void set_auto_accept_quit ( bool enabled )
void set_current_scene ( Node child_node )
void set_debug_collisions_hint ( bool enable )
void set_debug_navigation_hint ( bool enable )
void set_edited_scene_root ( Node scene )
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_network_peer ( NetworkedMultiplayerPeer peer )
void set_pause ( bool enable )
void set_refuse_new_network_connections ( bool refuse )
void set_screen_stretch ( int mode, int aspect, Vector2 minsize, float shrink=1 )

Signals

  • connected_to_server ( )
  • connection_failed ( )
  • idle_frame ( )
  • network_peer_connected ( int id )
  • network_peer_disconnected ( int id )
  • node_configuration_warning_changed ( Object node )
  • node_removed ( Object node )
  • physics_frame ( )
  • screen_resized ( )
  • server_disconnected ( )
  • tree_changed ( )

Numeric Constants

  • GROUP_CALL_DEFAULT = 0
  • GROUP_CALL_REVERSE = 1
  • GROUP_CALL_REALTIME = 2
  • GROUP_CALL_UNIQUE = 4
  • STRETCH_MODE_DISABLED = 0
  • STRETCH_MODE_2D = 1
  • STRETCH_MODE_VIEWPORT = 2
  • STRETCH_ASPECT_IGNORE = 0
  • STRETCH_ASPECT_KEEP = 1
  • STRETCH_ASPECT_KEEP_WIDTH = 2
  • STRETCH_ASPECT_KEEP_HEIGHT = 3
  • STRETCH_ASPECT_EXPAND = 4

Member Function Description

  • Node get_current_scene ( ) const
  • Node get_edited_scene_root ( ) const
  • int get_frame ( ) const
  • int get_network_unique_id ( ) const
  • int get_node_count ( ) const
  • int get_rpc_sender_id ( ) const
  • bool has_network_peer ( ) const

Returns true if there is a NetworkedMultiplayerPeer set (with SceneTree.set_network_peer).

  • bool is_debugging_collisions_hint ( ) const
  • bool is_debugging_navigation_hint ( ) const
  • bool is_input_handled ( )
  • bool is_network_server ( ) const

Returns true if this SceneTree’s NetworkedMultiplayerPeer is in server mode (listening for connections).

  • bool is_paused ( ) const
  • bool is_refusing_new_network_connections ( ) 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 ( )
  • int reload_current_scene ( )
  • void set_auto_accept_quit ( bool enabled )
  • void set_current_scene ( Node child_node )
  • void set_debug_collisions_hint ( bool enable )
  • void set_debug_navigation_hint ( bool enable )
  • void set_edited_scene_root ( Node scene )
  • void set_input_as_handled ( )

Set the peer object to handle the RPC system (effectively enabling networking). Depending on the peer itself, the SceneTree will become a network server (check with is_network_server()) and will set root node’s network mode to master (see NETWORK_MODE_* constants in Node), or it will become a regular peer with root node set to slave. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to SceneTree’s signals.

  • void set_pause ( bool enable )
  • void set_refuse_new_network_connections ( bool refuse )