class-description NEWS COMMUNITY STORE LABS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE LABS TOGGLE FULLSCREEN VOLLBILD AN/AUS Object MainLoop
Abstract base class for the game's main loop.

MainLoop is the abstract base class for a Godot project's game loop. It is inherited by SceneTree, which is the default game loop implementation used in Godot projects, though it is also possible to write and use one's own MainLoop subclass instead of the scene tree.

Upon the application start, a MainLoop implementation must be provided to the OS; otherwise, the application will exit. This happens automatically (and a SceneTree is created) unless a MainLoop Script is provided from the command line (with e.g. godot -s my_loop.gd) or the "Main Loop Type" project setting is overwritten.

Here is an example script implementing a simple MainLoop:

class_name CustomMainLoop extends MainLoop var time_elapsed = 0 func _initialize(): print("Initialized:") print(" Starting time: %s" % str(time_elapsed)) func _process(delta): time_elapsed += delta # Return true to end the main loop. return Input.get_mouse_button_mask() != 0 || Input.is_key_pressed(KEY_ESCAPE) func _finalize(): print("Finalized:") print(" End time: %s" % str(time_elapsed))
on_request_permissions_result on_request_permissions_result<>( String permission=, permission:String=, bool granted=, granted:bool=, ):on_request_permissions_result

Emitted when a user responds to a permission request.

void _finalize<>():void

Called before the program exits.

void _initialize<>():void

Called once during initialization.

bool _physics_process<>( float delta=, delta:float=, ):bool

Called each physics frame with the time since the last physics frame as argument (delta, in seconds). Equivalent to Node._physics_process.

If implemented, the method must return a boolean value. true ends the main loop, while false lets it proceed to the next frame.

bool _process<>( float delta=, delta:float=, ):bool

Called each process (idle) frame with the time since the last process frame as argument (in seconds). Equivalent to Node._process.

If implemented, the method must return a boolean value. true ends the main loop, while false lets it proceed to the next frame.




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...