Class: ActionsRegister

b5. ActionsRegister

new b5.ActionsRegister()

core/actions.js, line 7

The ActionsRegister contains a list of all available actions. new action creators are added to this register.

The ActionsRegister is used by the Xoml system to instantiate actions lists from JSON.

Below is an example that shows how to register an action that can be used from the Xoml system:

 b5.ActionsRegister.register("ChangeActions", function(p) { return new b5.A_ChangeActions(p[1], p[2]); });

For a complete overview of Actions see Booty5 Actions Overview

Methods

staticb5.ActionsRegister.create(action_name, params){object}

core/actions.js, line 39

Creates an action from the supplied name and parameters

Name Type Description
action_name string

The action name, e.g. A_Sound

params Array.<any>

Array of parameters to pass to creation function

Returns:
Type Description
object Created action

staticb5.ActionsRegister.register(action_name, creator_func)

core/actions.js, line 29

Registers a new action creator

Name Type Description
action_name string

The action name, e.g. A_Sound

creator_func function

Function that creates an instance of the action