Program class contains all the data of a nunuStudio program.
Is stores and manages all available resources used by the children objects.
Is responsible for handling runtime tasks, initialization, update, resizes etc.
Add new scene to this program.
On the program class only scenes can be added as children.
Clone program, keeping uuids and every identification attribute.
Clone method uses the ObjectLoad to serialize and create a new program instance with the same data.
Enter virtual reality mode.
To enter virtual reality mode a WebVR enabled browser is required.
When displaying VR content the display.requestAnimationFrame should be used to call the render method.
Dispose program data to avoid memory leaks.
Called when exiting the program.
Exit virtual relity mode.
Select initial scene and initialize that scene.
Automatically called by the runtime.
Receive external data and pass it to all script instances.
Remove Scene from program.
Render current scene to canvas.
When rendering in VR mode all effects and camera parameters are ignored.
Renderer should be initialized and passed as argument.
Resize the current scene elements.
Send data to external app instance.
Set a scene as initial scene using its uuid.
This method is used by the editor.
Set program mouse and keyboard.
Set program renderer to be used by this program.
Three.js renderer to be used by this program
If true also updates renderer configuration to match rendering quality specified in the program.
Change scene during runtime, this method can receive booth a scene name or a scene object.
This method should be used inside of script objects during runtime.
sceneScene | String
Scene object or name of the scene to be used.
Serialize the object to JSON format.
Metadata object passed to the objects and resources toJSON method to store data.
If true all resouces in the program are exported, else only resources attached to objects are exported
json Serialized JSON data containing the program, all scenes and resources stored.
Update program state, this updated all current scene children elements.
This method updated the webgl renderer configuration.
Should be called after changing any rendering related parameter.
NunuRuntime instance used to communication between nunu app and the host webpage.
Inside the editor communication with the app is simulated on the debug console.
Canvas being used to draw content.
This canvas is where the WebGL rendering context was created.
Clock object used to measure times between frames.
Default camera to be used by scenes where there is no camera.
On the editor this value is automatically set to the last editor camera point used
Scene loaded as default on startup.
DOM Division element that can be used to add html content to the app.
All content added to this division should be manually removed before the app exits.
Flag to indicate if the runtime should handle device pixel ratio.
Keyboard input object.
Flag to control pointer locking.
Event manager used to handle VR display presentation change event.
Mouse input object.
Renderer being used during runtime.
Renderer configuration applied to the WebGL renderer.
Scene currently running in the program.
Enable virtual reality flag.
Virtual reality movement scale.
Indicates the relation between the real movement and virtual world movement.