FORGE. Group

new Group(viewer, config)

A FORGE.Group is an object that represents a group of FORGE.Scene objects.
Parameters:
Name Type Description
viewer FORGE.Viewer FORGE.Viewer reference.
config GroupConfig The group config object.
Source:

Extends

Members

(readonly) alive :boolean

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

(readonly) alpha :number

Get the alpha associated to this group.
Type:
  • number
Source:

(readonly, nullable) children :Array.<Object>

Get the Array of children objects that compose this group.
Type:
  • Array.<Object>
Source:

(readonly, nullable) childrenUids :Array.<string>

Get the Array of children uids that compose this group.
Type:
  • Array.<string>
Source:

(readonly) className :string

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

(readonly) color :string

Get the color associated to this group.
Type:
  • string
Source:

(readonly) config :Object

Get the group 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 this group.
Type:
  • string
Source:

(readonly, nullable) groups :Array.<FORGE.Group>

Get the Array of FORGE.Group uids that compose this group.
Type:
Source:

(readonly, nullable) groupsUids :Array.<string>

Get the Array of FORGE.Group uids that compose this group.
Type:
  • Array.<string>
Source:

(readonly) name :string

Get the name of this group.
Type:
  • 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, nullable) scenes :Array.<FORGE.Scene>

Get the Array of FORGE.Scene objects that compose this group.
Type:
Source:

(readonly, nullable) scenesUids :Array.<string>

Get the Array of FORGE.Scene uids that compose this group.
Type:
  • Array.<string>
Source:

(readonly) slug :string

Get the slug name of this group.
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:

(readonly) viewCount :number

Get the count of how many times this group has been viewed.
Type:
  • number
Source:

(readonly) viewed :boolean

Know if this group has been viewed at least one time.
Type:
  • boolean
Source:

warning :boolean

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

Methods

destroy()

Destroy method.
Overrides:
Source:

getChildren(classNameopt) → {Array}

Get children objects of a specified className.
If you do not specify className this method will return all the children objects.
Parameters:
Name Type Attributes Description
className string <optional>
the className of the object you want to get.
Source:
Returns:
Returns array of children objects of the specified className.
Type
Array

getChildrenUids(classNameopt) → {Array}

Get children uids of a specified className (or not).
Parameters:
Name Type Attributes Description
className string <optional>
the className of the object uids you want to get.
Source:
Returns:
Returns array of children uids of the specified className.
Type
Array

hasChildren() → {boolean}

Know if this group have any children.
Source:
Returns:
Returns true if this group have at least a children, false if not.
Type
boolean

hasGroup(value) → {boolean}

Know if a FORGE.Group is part of this group?
Parameters:
Name Type Description
value FORGE.Group | string Either the FORGE.Group or a uid string.
Source:
Returns:
Returns true if the group is part of this group, false if not.
Type
boolean

hasGroups() → {boolean}

Know if this group have any FORGE.Group.
Source:
Returns:
Returns true if this group have at least a FORGE.Group, false if not.
Type
boolean

hasScene(value) → {boolean}

Know if a FORGE.Scene is part of this group?
Parameters:
Name Type Description
value FORGE.Scene | string Either the FORGE.Scene or a uid string.
Source:
Returns:
Returns true if the scene is part of this group, false if not.
Type
boolean

hasScene(value) → {boolean}

Know if a FORGE.Scene, a FORGE.Group or a uid is part of this group?
Parameters:
Name Type Description
value FORGE.Scene | FORGE.Group | string Either the FORGE.Scene or a FORGE.Group or a uid string.
Source:
Returns:
Returns true if the child is part of this group, false if not.
Type
boolean

hasScenes() → {boolean}

Know if this group have any FORGE.Scene.
Source:
Returns:
Returns true if this group have at least a FORGE.Scene, false if not.
Type
boolean

hasTypeOfChild(className) → {boolean}

Know if this group have any object of a specified className.
Parameters:
Name Type Description
className string the className of the object you want to know if this group has in its children array.
Source:
Returns:
Returns true if this group have at least an object of the requested className in its children, false if not.
Type
boolean

load(value)

Load the group with a specific scene, by default the scene is scene index 0.
Parameters:
Name Type Description
value number | string | FORGE.Scene | FORGE.Group The numeric index of the child or the uid of the child you want to load.
If no value passed in arguments, the group will load its default child if it is set.
If no default child set, it will load its first child no matter the type of this child
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 this group.
If this group has no scene, you can't use this method.
If the current scene of the story is not one of this group, the group will load either the default child or its first found scene.
If the current scene is part of this group, nextScene will loop forward through its scenes.
Source:

previousScene()

Load the previous scene of this group.
If this group has no scene, you can't use this method.
If the current scene of the story is not one of this group, the group will load either the default child or its first found scene.
If the current scene is part of this group, previousScene will loop backward through its scenes.
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. Group

Members
Methods