API Documentation

for 0.0.1
Show:

ComponentProxy Class

ComponentProxy is a proxy that converts (like a kind of casting) scripts into Mobilizing Components. It was designed specifically to convert users script to regular Components, so they can be used besides all the other Components used by the program. The script should implement the methods preLoad(), setup(), update(). Users can define their own Component using this class for converting their script to a regular Mobilizing Component, we call it custom behavior.

Constructor

ComponentProxy

(
  • params
)

Parameters:

  • params Object

    Config parameters

    • targetScript Script

      The Mobilizing user's script to convert in a Component

Example:

//to do

Methods

byPass TODO!

()

chain

(
  • component
)

Adds a component to this chained component array

Parameters:

getChainedComponents

() Array

Returns the array of attached children components

Returns:

Array:

children arrays

getContext

() Context

Inherited from Base but overwritten in src/js/Mobilizing/Base.js:37

Get the Mobilizing context

Returns:

Context:

The Mobilizing context

getID

() Int

Get the Object unique ID

Returns:

Int:

The Object ID

getStatus

() Boolean

Get the activation status of the component

Returns:

Boolean:

True if active, false otherwise

off

()

Deactivate the component

on

()

Activate the component A call to this method calls the setup method if it has not been run yet

postUpdate

()

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

preLoad

()

Inherited from Component but overwritten in src/js/Mobilizing/ComponentProxy.js:30

preUpdate

()

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

runSetup

()

Calls the setup if it has not already been called This method should not be called 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

setContext

(
  • context
)

Set the Mobilizing context

Parameters:

  • context Context

    The Mobilizing Context

setName

(
  • name
)

Set the Object name

Parameters:

  • name String

    The Object name

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

setup Setup

()

Initialization method

update

()

Inherited from Component but overwritten in src/js/Mobilizing/ComponentProxy.js:49

Properties

_active

Boolean private

Whether the component is active or not

_context

Context private

A reference to the Mobilizing context

_setupDone

Boolean private

Whether the component's setup has been called

events

EventEmitter

An event emmiter used to send custom events