ActionManager

Action Manager manages all events to be triggered on a given mesh or the global scene. A single scene can have many Action Managers to handle predefined actions on specific meshes.

see

http://doc.babylonjs.com/how_to/how_to_use_actions

Hierarchy

  • ActionManager

Index

Constructors

constructor

Find examples in Playground
  • Creates a new action manager

    Parameters

    • scene: Scene

      defines the hosting scene

    Returns ActionManager

Properties

actions

Find examples in Playground
actions: Action[]

Gets the list of actions

hasPickTriggers

Find examples in Playground
hasPickTriggers: boolean

Does this action manager has pick triggers

hasPointerTriggers

Find examples in Playground
hasPointerTriggers: boolean

Does this action manager has pointer triggers

hoverCursor

Find examples in Playground
hoverCursor: string

Gets the cursor to use when hovering items

Static HasPickTriggers

Find examples in Playground
HasPickTriggers: boolean

Does exist one action manager with at least one pick trigger

Static HasTriggers

Find examples in Playground
HasTriggers: boolean

Does exist one action manager with at least one trigger

Static NothingTrigger

Find examples in Playground
NothingTrigger: number

Static OnCenterPickTrigger

Find examples in Playground
OnCenterPickTrigger: number

Static OnDoublePickTrigger

Find examples in Playground
OnDoublePickTrigger: number

Static OnEveryFrameTrigger

Find examples in Playground
OnEveryFrameTrigger: number

Static OnIntersectionEnterTrigger

Find examples in Playground
OnIntersectionEnterTrigger: number

Static OnIntersectionExitTrigger

Find examples in Playground
OnIntersectionExitTrigger: number

Static OnKeyDownTrigger

Find examples in Playground
OnKeyDownTrigger: number

Static OnKeyUpTrigger

Find examples in Playground
OnKeyUpTrigger: number

Static OnLeftPickTrigger

Find examples in Playground
OnLeftPickTrigger: number

Static OnLongPressTrigger

Find examples in Playground
OnLongPressTrigger: number

Static OnPickDownTrigger

Find examples in Playground
OnPickDownTrigger: number

Static OnPickOutTrigger

Find examples in Playground
OnPickOutTrigger: number

On pick out. This trigger will only be raised if you also declared a OnPickDown

see

http://doc.babylonjs.com/how_to/how_to_use_actions#triggers

Static OnPickTrigger

Find examples in Playground
OnPickTrigger: number

Static OnPickUpTrigger

Find examples in Playground
OnPickUpTrigger: number

Static OnPointerOutTrigger

Find examples in Playground
OnPointerOutTrigger: number

Static OnPointerOverTrigger

Find examples in Playground
OnPointerOverTrigger: number

Static OnRightPickTrigger

Find examples in Playground
OnRightPickTrigger: number

Static Triggers

Find examples in Playground
Triggers: object

Gets the list of active triggers

Type declaration

  • [key: string]: number

Methods

dispose

Find examples in Playground
  • dispose(): void
  • Releases all associated resources

    Returns void

getScene

Find examples in Playground
  • Gets hosting scene

    Returns Scene

    the hosting scene

hasSpecificTrigger

Find examples in Playground
  • hasSpecificTrigger(trigger: number, parameterPredicate?: function): boolean
  • Does this action manager handles actions of a given trigger

    Parameters

    • trigger: number

      defines the trigger to be tested

    • Optional parameterPredicate: function

      defines an optional predicate to filter triggers by parameter

        • (parameter: any): boolean
        • Parameters

          • parameter: any

          Returns boolean

    Returns boolean

    whether the trigger is handled

hasSpecificTriggers

Find examples in Playground
  • hasSpecificTriggers(triggers: number[]): boolean
  • Does this action manager handles actions of any of the given triggers

    Parameters

    • triggers: number[]

      defines the triggers to be tested

    Returns boolean

    a boolean indicating whether one (or more) of the triggers is handled

hasSpecificTriggers2

Find examples in Playground
  • hasSpecificTriggers2(triggerA: number, triggerB: number): boolean
  • Does this action manager handles actions of any of the given triggers. This function takes two arguments for speed.

    Parameters

    • triggerA: number

      defines the trigger to be tested

    • triggerB: number

      defines the trigger to be tested

    Returns boolean

    a boolean indicating whether one (or more) of the triggers is handled

processTrigger

Find examples in Playground
  • processTrigger(trigger: number, evt?: ActionEvent): void
  • Process a specific trigger

    Parameters

    • trigger: number

      defines the trigger to process

    • Optional evt: ActionEvent

      defines the event details to be processed

    Returns void

registerAction

Find examples in Playground
  • Registers an action to this action manager

    Parameters

    • action: Action

      defines the action to be registered

    Returns Nullable<Action>

    the action amended (prepared) after registration

serialize

Find examples in Playground
  • serialize(name: string): any
  • Serialize this manager to a JSON object

    Parameters

    • name: string

      defines the property name to store this manager

    Returns any

    a JSON representation of this manager

unregisterAction

Find examples in Playground
  • unregisterAction(action: Action): Boolean
  • Unregisters an action to this action manager

    Parameters

    • action: Action

      defines the action to be unregistered

    Returns Boolean

    a boolean indicating whether the action has been unregistered

Static GetTriggerName

Find examples in Playground
  • GetTriggerName(trigger: number): string
  • Get a trigger name by index

    Parameters

    • trigger: number

      defines the trigger index

    Returns string

    a trigger name

Static HasSpecificTrigger

Find examples in Playground
  • HasSpecificTrigger(trigger: number): boolean
  • Does exist one action manager that handles actions of a given trigger

    Parameters

    • trigger: number

      defines the trigger to be tested

    Returns boolean

    a boolean indicating whether the trigger is handeled by at least one action manager

Static Parse

Find examples in Playground
  • Creates a new ActionManager from a JSON data

    Parameters

    • parsedActions: any

      defines the JSON data to read from

    • object: Nullable<AbstractMesh>

      defines the hosting mesh

    • scene: Scene

      defines the hosting scene

    Returns void

Generated using TypeDoc