Nunu Class
nunuStudio core main file.
Store nunuStudio development version and timestamp and contains global method to check browser feature support.
Item Index
Methods
Methods
copyNamespace
()
static
Import stuff from a namespace to another target namespace.
If not target is specified window is used.
createWorker
-
code
-
onMessage
Create a web worker from code written in a string.
Uses a blob to inject the code and loads it from and URL object.
Parameters:
-
code
StringJavascript code for this worker.
-
onMessage
FunctionOn message worker callback.
Returns:
Returns a worker instance (for comunication).
developmentMode
()
Boolean
Check if nunu if running in development mode.
Returns:
True if running as development mode.
enterVR
-
renderer
-
onSuccess
Enter virtual reality mode using WebXR or WebVR depending on the API available.
If booth API are available the WebXR API is used.
When displaying VR content the display.requestAnimationFrame should be used to call the render method.
Parameters:
-
renderer
WebGLRendererRenderer used to draw the scene.
-
onSuccess
FunctionMethod called if the application entered VR successfully.
exitVR
-
renderer
Enter virtual reality mode, if the application is not running on VR mode does not do anything.
Parameters:
-
renderer
WebGLRendererRenderer used to draw the scene.
getPlatform
()
Number
Check in wich platform the enviroment is running.
Possible return values are:
- Nunu.NWJS
- Nunu.BROWSER
- Nunu.CORDOVA
Returns:
Indicates the platform type.
getQueryParameters
()
Object
Get the query parameter from the browser URL.
Returns:
Object with parameters read from the URL.
getVRDisplays
-
onDisplay
Used to get the first VR display available, the display is returned as argument of the onDisplay function.
Parameters:
-
onDisplay
FunctionFunction used to get the display, receives the display as argument.
getXRSession
-
onSession
Get WebXR session.
Parameters:
-
onSession
FunctionFunction used to get the XR session, receives the session as argument.
isFullscreen
()
Boolean
Check if there is some element on fullscreen mode.
Returns true even the fullscreen element is not related with the app.
Returns:
True if there is some element in fullscreen mode.
openWebpage
()
Open a webpage on a new window.
On desktop and mobile it will open the default browser.
On the web it will open as a popup.
runningOnDesktop
()
Boolean
Check if nunu is running inside NWJS.
Returns:
True if running inside NWJS
setFullscreen
-
fullscreen
-
element
Set an element into fullscreen mode or exit out of fullscreen mode.
Uses isFullscreen to check if the application is running in fullscreen mode already.
Parameters:
-
fullscreen
BooleanIf true the application will enter fullscreen mode, if false it will exit, if undefine it will toggle the value.
-
element
ComponentDOM element to put into fullscreen.
vrAvailable
()
Boolean
Check if there is any VR API available, on the device.
Checks if there is support for WebVR or WebXR.
Returns:
True if the browser supports vr.
webAudioAvailable
()
Boolean
Check if host supports WebAudio.
Returns:
True if WebAudio is available.
webglAvailable
()
Boolean
Check if host supports WebGL, only checks for WebGL 1.0 support.
Returns:
True if WebGL is available.
webVRAvailable
()
Boolean
Check if host supports WebVR.
Returns:
True is WebVR is available.
webXRAvailable
()
Boolean
Check if host supports WebXR.
Returns:
True is WebVR is available.