Nunu Class

Module: Runtime

nunuStudio MIT license (http://opensource.org/licenses/MIT)

Class used to store nunuStudio development version and timestamp.

Contains methods to check browser feature support.

Methods

createWorker

(
  • code
  • onMessage
)
Worker

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 String

    Javascript code for this worker.

  • onMessage Function

    On message worker callback.

Returns:

Worker:

Returns a worker instance (for comunication).

developmentMode

() Boolean

Check if nunu if running in development mode.

Returns:

Boolean:

True if running as development mode.

getVRDisplays

(
  • getDisplay
)

Used to get the first VR display available, the display is returned as argument of the getDisplay function.

Parameters:

  • getDisplay Function

    Function used to get the display, receives the display 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:

Boolean:

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:

Boolean:

True if running inside NWJS

setFullscreen

(
  • enable
  • element
)

Set an element into fullscreen mode or exit out of fullscreen mode.

Use isFullscreen to check if the application is running in fullscreen mode already.

Parameters:

  • enable Boolean

    If true the application will enter fullscreen mode, if false it will exit.

  • element DOM

    DOM element to put into fullscreen.

webAudioAvailable

() Boolean

Check if host supports WebAudio.

Returns:

Boolean:

True if WebAudio is available.

webglAvailable

() Boolean

Check if host supports WebGL, only checks for WebGL 1.0 support.

Returns:

Boolean:

True if WebGL is available.

webvrAvailable

() Boolean

Check if host supports WebVR and if there is a VR display available.

Returns:

Boolean:

True is WebVR is available.

Attributes

NAME

String

nunuStudio

Default: "nunuStudio"

TIMESTAMP

String

Stores the nunu runtime dev timestamp.

VERSION

String

Stores the nunu runtime version.