FORGE. Viewer

new Viewer(parent, config, callbacksnullable)

The main viewer class.
Parameters:
Name Type Attributes Description
parent HTMLElement | string The parent element.
config MainConfig | string Object that represents the project configuration, it can be an object or a json configuration url.
callbacks ViewerCallbacks <nullable>
On boot callbacks
Source:
To Do:
  • Create a FORGE.Config Object to define default values, that can be overrided by the config param.

Extends

Members

(static, constant) DEFAULT_CONFIG :ViewerConfig

Viewer default configuration
Type:
  • ViewerConfig
Source:

(readonly) actions :FORGE.ActionManager

Get the viewer action manager.
Type:
Source:

(readonly) alive :boolean

Get the alive flag value of the object.
Type:
  • boolean
Inherited From:
Source:

(readonly) audio :FORGE.SoundManager

Get the viewer audio/sound interface.
Type:
Source:

(readonly) cache :FORGE.Cache

Get the viewer cache.
Type:
Source:

(readonly) camera :FORGE.Camera

Get the camera.
Type:
Source:

(readonly) canvas :FORGE.Canvas

Get the viewer canvas.
Type:
Source:

(readonly) canvasContainer :FORGE.DisplayObjectContainer

Get the viewer canvas container.
Type:
Source:

(readonly) className :string

Get the class name of the object.
Type:
  • string
Inherited From:
Source:

(readonly) clock :FORGE.Clock

Get the viewer clock interface.
Type:
Source:

(readonly) config :ViewerConfig

Get the viewer configuration.
Type:
  • ViewerConfig
Source:

(readonly) container :FORGE.DisplayObjectContainer

Get the viewer container.
Type:
Source:

(readonly) controllers :FORGE.ControllerManager

Get controller manager.
Type:
Source:

data :*

Get and set any custom data you want to associate to this object.
Type:
  • *
Inherited From:
Source:

debug :boolean

Get and set the debug flag.
Type:
  • boolean
Inherited From:
Source:

(readonly) director :FORGE.Director

Get the director's cut track manager.
Type:
Source:

(readonly) display :FORGE.DisplayList

Get the viewer display list manager.
Type:
Source:

(readonly) domHotspotContainer :FORGE.DisplayObjectContainer

Get the viewer DOM hotspot container.
Type:
Source:

(readonly) domHotspotStyle :HTMLStyleElement

Get the viewer DOM hotspot style container.
Type:
  • HTMLStyleElement
Source:

fullscreen :boolean

Get and set the fullscreen property of the viewer main container.
Type:
  • boolean
Source:

(readonly) gamepad :FORGE.GamepadsManager

Get the viewer gamepad interface.
Type:
Source:

(readonly) gyroscope :FORGE.Gyroscope

Get the viewer gyroscope interface.
Type:
Source:

height :number

Get and set the viewer height.
Type:
  • number
Source:

(readonly) history :FORGE.History

Get the history module.
Type:
Source:

(readonly) hotspots :FORGE.HotspotManager

Get the viewer hotspots module.
Type:
Source:

(readonly) i18n :FORGE.LocaleManager

Get the viewer i18n and locales interface.
Type:
Source:

(readonly) keyboard :FORGE.Keyboard

Get the viewer keyboard interface.
Type:
Source:

(readonly) load :FORGE.Loader

Get the viewer loader.
Type:
Source:

(readonly) mainConfig :MainConfig

Get the main configuration.
Type:
  • MainConfig
Source:

(readonly) onConfigLoadComplete :FORGE.EventDispatcher

Get the "onConfigLoadComplete" FORGE.EventDispatcher of the viewer.
Type:
Source:

(readonly) onDestroy :FORGE.EventDispatcher

Get the onDestroy FORGE.EventDispatcher, this event is emitted at the end of the destroy sequence.
Type:
Inherited From:
Source:

(readonly) onMainConfigLoadComplete :FORGE.EventDispatcher

Get the "onMainConfigLoadComplete" FORGE.EventDispatcher of the viewer.
Type:
Source:

(readonly) onPause :FORGE.EventDispatcher

Get the "onPause" FORGE.EventDispatcher of the viewer.
Type:
Source:

(readonly) onReady :FORGE.EventDispatcher

Get the "onReady" FORGE.EventDispatcher of the viewer.
Type:
Source:

(readonly) onResume :FORGE.EventDispatcher

Get the "onResume" FORGE.EventDispatcher of the viewer.
Type:
Source:

(readonly) parent :HTMLElement|String

Get the viewer parent element.
Type:
  • HTMLElement | String
Source:

(readonly) playlists :FORGE.PlaylistManager

Get the viewer playlists for sounds.
Type:
Source:

(readonly) pluginContainer :FORGE.DisplayObjectContainer

Get the viewer plugin container.
Type:
Source:

(readonly) plugins :FORGE.PluginManager

Get the viewer plugins interface.
Type:
Source:

(readonly) postProcessing :FORGE.PostProcessing

Get the postProcessing object.
Type:
Source:

(readonly) raf :FORGE.RequestAnimationFrame

Get the viewer request animation frame interface.
Type:
Source:

(readonly) ready :boolean

Get the viewer ready status.
Type:
  • boolean
Source:

(readonly) renderer :FORGE.RenderManager

Get the viewer render manager.
Type:
Source:

(readonly) story :FORGE.Story

Get the story module.
Type:
Source:

(readonly) tags :Array

Get the tags associated to this object.
Type:
  • Array
Inherited From:
Source:

(readonly) tween :FORGE.TweenManager

Get the viewer tween interface.
Type:
Source:

(readonly) uid :string

Get the uid of the object.
Type:
  • string
Inherited From:
Source:

(readonly) view :FORGE.ViewManager

Get the view.
Type:
Source:

warning :boolean

Get and set the warning flag.
Type:
  • boolean
Inherited From:
Source:

width :number

Get and set the viewer width.
Type:
  • number
Source:

Methods

destroy()

Destroy method.
Overrides:
Source:

log(value)

Basic log method, log a string in the console if debug is enabled.
Parameters:
Name Type Description
value * The value you want to log in the console.
Inherited From:
Source:

pause(internal)

Pause the refresh on the main loop.
Parameters:
Name Type Description
internal boolean Internal lib usage
Source:

resume(internal)

Resume the refresh on the main loop.
Parameters:
Name Type Description
internal boolean Internal lib usage
Source:

update(time)

Update method called by the viewer main loop.
Parameters:
Name Type Description
time number Time in ms
Source:

warn(valuenullable)

Basic warn method, log a warn string in the console if warning is enabled.
Parameters:
Name Type Attributes Description
value string | Object <nullable>
The value you want to warn in the console.
Inherited From:
Source:

FORGE. Viewer

Members
Methods