Skip to content

class_scenemainloop

Ariel Manzur edited this page Jun 8, 2015 · 14 revisions

SceneMainLoop

####Inherits: MainLoop ####Category: Core

Brief Description

Scene-Based implementation of the MainLoop.

Member Functions

Signals

  • screen_resized ( )
  • node_removed ( Object node )
  • tree_changed ( )

Numeric Constants

  • GROUP_CALL_DEFAULT = 0 - Regular group call flag (no flags).
  • GROUP_CALL_REVERSE = 1 - Call a group in inverse-scene order.
  • GROUP_CALL_REALTIME = 2 - Call a group immediately (usually calls are delivered on idle).
  • GROUP_CALL_UNIQUE = 4 - Call a group only once, even if call is performed many times.
  • 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

Description

Scene implementation of the MainLoop. All scenes edited using the editor are loaded with this main loop, which provides the base for the scene system.

All group operations (get nodes, call, etc) is performed here. All nodes in a group can be called a specific functions, set a property or notified. This happens in scene-order.

Member Function Description

  • void notify_group ( int call_flags, String group, int notification )

Call a notification in all the nodes belonging to a given group. See GROUP_CALL_* enum for options.

  • void set_group ( int call_flags, String group, String property, var value )

Set a property in all the nodes belonging to a given group. See GROUP_CALL_* enum for options.

Get all the nods belonging to a given group.

  • void set_auto_accept_quit ( bool enabled )

Set to true if the application will quit automatically when quit is requested (Alt-f4 or ctrl-c).

  • void set_editor_hint ( bool enable )

Set to true to tell nodes and the scene that it is being edited. This is used by editors, not release.

  • bool is_editor_hint ( ) const

Return true if the scene is being run inside an editor.

  • void set_pause ( bool enable )

Set pause. The built-in pause system is very basic and only meant to avoid processing nodes not allowed to work in pause mode.

  • bool is_paused ( ) const

Return true if the scene is paused.

  • void set_input_as_handled ( )

Handle a current input event (avoid further processing of it).

  • int get_frame ( ) const

Return the frame index (how many frames were drawn).

  • void quit ( )

Quit the application.

  • void queue_delete ( Object obj )

Queue an object for deletion next time the loop goes idle.

  • void call_group ( int flags, String group, String method, var arg0=NULL, var arg1=NULL, var arg2=NULL, var arg3=NULL, var arg4=NULL )

Call a function for all the nodes in a given group.

(c) Juan Linietsky, Ariel Manzur, Distributed under the terms of the CC By license.

Clone this wiki locally