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) alive :boolean
Get the alive flag value of the object.
Type:
- boolean
- Inherited From:
- 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) config :ViewerConfig
Get the viewer configuration.
Type:
- ViewerConfig
- 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) 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) 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) pluginContainer :FORGE.DisplayObjectContainer
Get the viewer plugin container.
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) tags :Array
Get the tags associated to this object.
Type:
- Array
- Inherited From:
- Source:
(readonly) uid :string
Get the uid of the object.
Type:
- string
- Inherited From:
- Source:
warning :boolean
Get and set the warning flag.
Type:
- boolean
- Inherited From:
- 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: