App

The application is the core subsystem behind NRG it defines all the main features that your app. will be using at runtime. On top of controlling visual properties, it also allows you to set all the basic settings that your application will use including orientation, physics engine, graphics capabilities etc...

See Also

Static Variables


Name Description
state Current playback state State of the Application.
soundconfig Current SfxConfig used by the Application.
listener Access the application Listener properties.
stats Access the global AppStats (application statistics).
scene_count Total amount of Scene currently loaded by your application.
handler Handler that manage the scripting functionalities of the application.
world Reference to the physics World of your application (if any).
platform_id Unique id identifying the platform your application is running on.
platform The current platform name running your application (see platform_id).
load_count Number of Asset to load asynchronously.
unload_count Number of Asset to unload asynchronously.
event The internal AppEvent associated to the App subsystem.

Variables


Name Description
profile The OpenGL/ES profile that should be used/emulated to run your application.
startup_scene Unique id of the Scene to load by default when the application start.
orientation The required Orientation your application should use (mobile only).
extensions Bit mask of all requires graphics extensions.
play_fullscreen Force the application to run fullscreen by default (desktop only).

Functions


Name Description
Start Load and start running the application.
Play Start or resume the application playback.
Pause Return the internal index of a Animation reference.
Stop Stop the application playback.
Step Put the application on pause and step one frame.
Reset Reset the application.
Update Manually trigger the update of a specific Scene.
Sync Force the application to synchronize based on a specific time step.
LoadScene Load a Scene using its name.
LoadSceneAdditive Additively load an existing Scene Asset. Using this function will force all Object contained in the Scene to be appended to the base Scene provided.
GetScene Retrieve an active Scene loaded by name.
GetSceneAt Retrieve a loaded Scene by index.
GetSceneIndex Retrieve the rendering index of a loaded Scene.
SetSceneIndex Change the rendering index of a specific Scene currently loaded.
UnloadScene Unload a loaded Scene by name.
UnloadAll Unload all Scene.
AddPhysics Create a new physics World for realtime simulation.
RemovePhysics Remove physics from your application and destroy the World (if any).
LoadAssetAsync Add an Asset to be loaded asynchronously.
UnloadAssetAsync Unload an Asset asynchronously.
LoadObjectAsync Add an Object to be loaded asynchronously.
UnloadObjectAsync Unload an Object asynchronously.
ClearLoadAsync Clear the load async. list of a specific type.
UnloadAsync Add an Asset to be unloaded asynchronously.
ClearUnloadAsync Clear the unload async. list of a specific type.
GetPath Retrieve the current application path.
IsRunning Helper function to determine if the application is running.
GetTouche Retrieve an active Touche on screen.
IsGamepad Helper function to determine if the application is running.
GetGamepad Retrieve the current states of a specific Gamepad.
GetKey Retrieve a specific Key.

Events


Callbacks Description
OnStart Occur once when the application start right after the startup_scene is loaded.
OnPlay This callback gets called when the application received the signal to start playing.
OnResume Triggered if the application was paused and then start playing again.
OnPause Triggered when the application gets paused.
OnStop Called when the application received the stop signal.
OnLoad Occur each time a new Scene is loaded.
OnUnload Occur each time a Scene is unloaded.
OnUpdate Triggered once per frame; upon each update.
OnDraw This callback is triggered each time the application is ready to draw a new frame.
OnDisplay This callback happen right after the application have finish draw all Scene.
OnTouchesBegan Triggered when a new input from the pointing device touches the screen.
OnTouchesMoved Occur each time a touche is moved on screen.
OnTouchesEnded Happen when a touche realease the screen.
OnAccelerometer Triggered on each accelerometer updates.
OnGyroscope This callback occur on each gyroscope updates.
OnGamepad Occur when a gamepad is either plugged in or out.
OnGamepadAxis Occur each time a gamepad axis changes.
OnGamepadButtons Occur each time a gamepad button is pressed or released.
OnKeyboard Triggered everytime a key on the keyboard is either pressed or released.




NRG - API 2022.4.384543 - Fri Nov 4 2022
Copyright © 2022 nrgcore.com. All Rights Reserved. Terms of Service - Privacy Policy - EULA