FORGE. PluginObjectFactory

new PluginObjectFactory(viewer, plugin)

Factory helper to create object inside plugins.
The factory knows what objects are created for a plugin, so it can destroy all object of the plugin at plugin destroy.
Parameters:
Name Type Description
viewer FORGE.Viewer FORGE.Viewer reference.
plugin FORGE.Plugin The FORGE.Plugin that will use this factory.
Source:
To Do:
  • add the file key restriction for i18n stuff

Extends

Members

(readonly) alive :boolean

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

(readonly) className :string

Get the class name of the object.
Type:
  • string
Inherited From:
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) onDestroy :FORGE.EventDispatcher

Get the onDestroy FORGE.EventDispatcher, this event is emitted at the end of the destroy sequence.
Type:
Inherited From:
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

button(config) → {FORGE.Button}

Add a FORGE.Button.
Parameters:
Name Type Description
config ButtonConfig The button configuration object.
Source:
Returns:
Returns the created FORGE.Button.
Type
FORGE.Button

canvas() → {FORGE.Canvas}

Add a FORGE.Canvas.
Source:
Returns:
Returns the created FORGE.Canvas.
Type
FORGE.Canvas

destroy()

Destroy method.
Overrides:
Source:

destroyAllObjects()

Destroy all objects.
Source:

displayObject(dom) → {FORGE.DisplayObject}

Parameters:
Name Type Description
dom Element | HTMLElement Dom object.
Source:
Returns:
Returns the created FORGE.DisplayObject.
Type
FORGE.DisplayObject

displayObjectContainer(dom) → {FORGE.DisplayObjectContainer}

Parameters:
Name Type Description
dom Element | HTMLElement Dom object.
Source:
Returns:
Returns the created FORGE.DisplayObjectContainer.
Type
FORGE.DisplayObjectContainer

image(config, relativeToPluginPath) → {FORGE.Image}

Add a FORGE.Image.
Parameters:
Name Type Description
config string | Object URL of the image or an image configuration object.
relativeToPluginPath boolean
Source:
Returns:
Returns the created FORGE.Image.
Type
FORGE.Image

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:

sound(key, url) → {FORGE.Sound}

Add a FORGE.Sound.
Parameters:
Name Type Description
key string Object key.
url string The sound url.
Source:
Returns:
Returns the created FORGE.Sound.
Type
FORGE.Sound

sprite(config, relativeToPluginPath) → {FORGE.Image}

Add a FORGE.Sprite.
Parameters:
Name Type Description
config Object Sprite configuration object.
relativeToPluginPath boolean
Source:
Returns:
Returns the created FORGE.Sprite.
Type
FORGE.Image

string(key) → {FORGE.LocaleString}

Parameters:
Name Type Description
key string Object key.
Source:
Returns:
Returns the created FORGE.LocaleString.
Type
FORGE.LocaleString

textField(config) → {FORGE.TextField}

Add a FORGE.Textfield.
Parameters:
Name Type Description
config string | TextFieldConfig Object configuration.
Source:
Returns:
Returns the created FORGE.Textfield.
Type
FORGE.TextField

tween(object) → {FORGE.Tween}

Add a FORGE.Tween.
Parameters:
Name Type Description
object Object
Source:
Returns:
Returns the created FORGE.Tween.
Type
FORGE.Tween

video(key, configopt, nullable, streamingopt, qualityModeopt, ambisonicopt) → {FORGE.VideoHTML5|FORGE.VideoDash}

Add a FORGE.Video.
Parameters:
Name Type Attributes Description
key string The video Id reference.
config string | FORGE.VideoQuality | Array.<(FORGE.VideoQuality|string)> <optional>
<nullable>
The video configuration object
streaming string <optional>
The video streaming format. Can be "HTML5" or "DASH".
qualityMode string <optional>
The video quality mode. Can be "auto" or "manual".
ambisonic boolean <optional>
3D sound including ambisonics. For "HTML5" video only.
Source:
Returns:
Returns the created FORGE.Video object.
Type
FORGE.VideoHTML5 | FORGE.VideoDash

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. PluginObjectFactory

Members
Methods