new Story(viewer)
The FORGE.Story manages groups and scenes of the project's story.
Parameters:
Name | Type | Description |
---|---|---|
viewer |
FORGE.Viewer | FORGE.Viewer reference. |
- Source:
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:
(readonly) config :Object
Get the story config object.
Type:
- Object
- 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) description :string
Get the description of the story.
Type:
- string
- Source:
group :FORGE.Group
Get the current FORGE.Group object, or set the current scene passing the FORGE.Group object itself, its index or uid.
Type:
- Source:
(readonly, nullable) groups :Array.<FORGE.Group>
Get the Array of FORGE.Group that compose the story.
Type:
- Array.<FORGE.Group>
- Source:
(readonly) groupUids :Array.<string>
Get all the group Uids.
Type:
- Array.<string>
- 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) onGroupChange :FORGE.EventDispatcher
Get the onGroupChange FORGE.EventDispatcher.
Type:
- Source:
(readonly) onSceneLoadComplete :FORGE.EventDispatcher
Get the onSceneLoadComplete FORGE.EventDispatcher.
Type:
- Source:
(readonly) onSceneLoadError :FORGE.EventDispatcher
Get the onSceneLoadError FORGE.EventDispatcher.
Type:
- Source:
- To Do:
-
- This event is currently not dispatched
(readonly) onSceneLoadProgress :FORGE.EventDispatcher
Get the onSceneLoadProgress FORGE.EventDispatcher.
Type:
- Source:
- To Do:
-
- This event is currently not dispatched
(readonly) onSceneLoadRequest :FORGE.EventDispatcher
Get the onSceneLoadRequest FORGE.EventDispatcher.
Type:
- Source:
(readonly) onSceneLoadStart :FORGE.EventDispatcher
Get the onSceneLoadStart FORGE.EventDispatcher.
Type:
- Source:
(readonly) onScenePreview :FORGE.EventDispatcher
Get the onScenePreview FORGE.EventDispatcher.
Type:
- Source:
- To Do:
-
- This event is currently not dispatched
scene :FORGE.Scene
Get the current FORGE.Scene object, or set the current scene passing the FORGE.Scene object itself, its index or uid.
Type:
- Source:
(readonly, nullable) scenes :Array.<FORGE.Scene>
Get the Array of FORGE.Scene that compose the story.
Type:
- Array.<FORGE.Scene>
- Source:
(readonly) sceneUids :Array.<string>
Get all the sceneUids.
Type:
- Array.<string>
- Source:
(readonly) slug :string
Get the slug name of the story.
Type:
- string
- 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
boot()
Boot sequence.
- Source:
destroy()
Destroy method.
- Overrides:
- Source:
hasGroups() → {boolean}
Know if the story have any FORGE.Group.
- Source:
Returns:
Returns true if the story have at least a FORGE.Group, false if not.
- Type
- boolean
hasScenes() → {boolean}
Know if the story have any FORGE.Scene.
- Source:
Returns:
Returns true if the story have at least a FORGE.Scene, false if not.
- Type
- boolean
load(config)
Load a JSON story configuration.
Parameters:
Name | Type | Description |
---|---|---|
config |
string | StoryConfig | The URL of the configuration JSON file to load or a story configuration object. |
- Source:
loadGroup(value)
Internal method to load a FORGE.Group.
Parameters:
Name | Type | Description |
---|---|---|
value |
FORGE.Group | number | string | Either the FORGE.Group itself its index in the main _groups Array or its uid. |
- Source:
loadScene(value)
Load a FORGE.Scene.
Parameters:
Name | Type | Description |
---|---|---|
value |
FORGE.Scene | number | string | Either the FORGE.Scene itself its index in the main _scenes Array or its uid. |
- 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:
nextScene()
Load the next scene of the story.
- Source:
previousScene()
Load the previous scene of the story.
- 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: