import MultiScriptContext from '@mobilizing/library/js/Mobilizing/core/context/MultiScriptContext.js'
MultiScriptContext
A class to instanciate a Mobilizing Context with mutliple script support. In this context, 1 ThreeRenderer and 1 AudioRenderer are shared with multiple user script. One 3D Scene is used for all the user scripts that are attached to this context.
Constructor Summary
Public Constructor | ||
public |
Member Summary
Method Summary
Public Methods | ||
public | addRootNode(node: Node) | |
public | ||
public | argIsBoolean(arg: Mixed): * | |
public | getRootNode(name: String): Node | |
public | setup() |
Inherited Summary
From class Component | ||
public | ||
public | context: * | |
public | events: * | |
public | id: * | |
public | name: * | |
private | _nexts: *[] | |
private | ||
public | byPass() | |
public | Adds a component to this chained component array | |
public | Returns the array of attached children components | |
public | off() Deactivate the component | |
public | on() Activate the component A call to this method calls the setup method if it has not been run yet | |
public | Run code after the update of all components is run This empty method is usually overriden to perform post-update actions for the component It is called periodically by an internal Mobilizing mechanism | |
public | preLoad() preLoad the component This empty method is usually overriden to perform preLoad actions for the component. | |
public | Run code before the update of all components is run This empty method is usually overriden to perform pre-update actions for the component It is called once per component by an internal Mobilizing mechanism | |
public | prepare() prepare the component This empty method is usually overriden to perform preparation actions for the component, from external process as a server. | |
public | setup() Set's up the component This empty method is usually overriden to perform setup actions for the component This is where all the initialization (such as adding event listeners)should be done It is called automatically by an internal Mobilizing mechanism and should thus not be called directly | |
public | update() Update the component This empty method is usually overriden to perform update actions for the component It is called periodically by an internal Mobilizing mechanism |
From class Context | ||
public | components: *[] | |
public | events: * | |
public | loader: * | |
public | ||
public | addComponent(component: Component): Component Add a Component to this context | |
public | chainedCall(component: Component, method: String, arg: Any) | |
public | preLoad() preLoad all components | |
public | prepare() Can be used to prepare something (ie : params comming from network server!) after construction but before preLoad | |
public | setup() Setup for this Context instance (setup all components that are already instantied) | |
public | update() Update |
Public Constructors
public constructor() source
Mobilizing.js defines a context to enable the use of multiple Mobilizing.js instances in the same webpage.
Override:
Context#constructorPublic Members
public camera: * source
public light: * source
public mouse: * source
public pointer: * source
public renderer: * source
public rendererAudio: * source
public rootNodes: {} source
public scripts: *[] source
public touch: * source
Public Methods
public addRootNode(node: Node) source
Params:
Name | Type | Attribute | Description |
node | Node | a Node that MUST have a name! |
public getRootNode(name: String): Node source
Params:
Name | Type | Attribute | Description |
name | String | the node's name to get from the all the root nodes |
Return:
Node | the root node |
public setup() source
Setup for this Context instance (setup all components that are already instantied)