Options
All
  • Public
  • Public/Protected
  • All
Menu

Class 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

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

Hierarchy

Implements

Index

Constructors

constructor

  • Creates a new action manager

    Parameters

    • scene: Scene

      defines the hosting scene

    Returns ActionManager

Properties

actionsSearch playground for actions

actions: IAction[]

Gets the list of actions

hoverCursorSearch playground for hoverCursor

hoverCursor: string

Gets the cursor to use when hovering items

isRecursiveSearch playground for isRecursive

isRecursive: boolean

Gets or sets a boolean indicating that the manager is recursive meaning that it can trigger action from children

Static Readonly NothingTriggerSearch playground for NothingTrigger

NothingTrigger: number

Static Readonly OnCenterPickTriggerSearch playground for OnCenterPickTrigger

OnCenterPickTrigger: number

Static Readonly OnDoublePickTriggerSearch playground for OnDoublePickTrigger

OnDoublePickTrigger: number

Static Readonly OnEveryFrameTriggerSearch playground for OnEveryFrameTrigger

OnEveryFrameTrigger: number

Static Readonly OnIntersectionEnterTriggerSearch playground for OnIntersectionEnterTrigger

OnIntersectionEnterTrigger: number

Static Readonly OnIntersectionExitTriggerSearch playground for OnIntersectionExitTrigger

OnIntersectionExitTrigger: number

Static Readonly OnKeyDownTriggerSearch playground for OnKeyDownTrigger

OnKeyDownTrigger: number

Static Readonly OnKeyUpTriggerSearch playground for OnKeyUpTrigger

OnKeyUpTrigger: number

Static Readonly OnLeftPickTriggerSearch playground for OnLeftPickTrigger

OnLeftPickTrigger: number

Static Readonly OnLongPressTriggerSearch playground for OnLongPressTrigger

OnLongPressTrigger: number

Static Readonly OnPickDownTriggerSearch playground for OnPickDownTrigger

OnPickDownTrigger: number

Static Readonly OnPickOutTriggerSearch playground for OnPickOutTrigger

OnPickOutTrigger: number

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

see

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

Static Readonly OnPickTriggerSearch playground for OnPickTrigger

OnPickTrigger: number

Static Readonly OnPickUpTriggerSearch playground for OnPickUpTrigger

OnPickUpTrigger: number

Static Readonly OnPointerOutTriggerSearch playground for OnPointerOutTrigger

OnPointerOutTrigger: number

Static Readonly OnPointerOverTriggerSearch playground for OnPointerOverTrigger

OnPointerOverTrigger: number

Static Readonly OnRightPickTriggerSearch playground for OnRightPickTrigger

OnRightPickTrigger: number

Static TriggersSearch playground for Triggers

Triggers: {}

Gets the list of active triggers

Type declaration

  • [key: string]: number

Accessors

hasPickTriggers

  • get hasPickTriggers(): boolean

hasPointerTriggers

  • get hasPointerTriggers(): boolean

Static HasPickTriggers

  • get HasPickTriggers(): boolean
  • Does exist one action manager with at least one pick trigger

    Returns boolean

Static HasTriggers

  • get HasTriggers(): boolean
  • Does exist one action manager with at least one trigger

    Returns boolean

Methods

disposeSearch playground for dispose

  • dispose(): void

getSceneSearch playground for getScene

  • Gets hosting scene

    Returns Scene

    the hosting scene

hasSpecificTriggerSearch playground for hasSpecificTrigger

  • hasSpecificTrigger(trigger: number, parameterPredicate?: (parameter: any) => boolean): boolean
  • Does this action manager handles actions of a given trigger

    Parameters

    • trigger: number

      defines the trigger to be tested

    • Optional parameterPredicate: (parameter: any) => boolean

      defines an optional predicate to filter triggers by parameter

        • (parameter: any): boolean
        • Parameters

          • parameter: any

          Returns boolean

    Returns boolean

    whether the trigger is handled

hasSpecificTriggersSearch playground for hasSpecificTriggers

  • 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

hasSpecificTriggers2Search playground for hasSpecificTriggers2

  • 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

processTriggerSearch playground for processTrigger

  • Process a specific trigger

    Parameters

    • trigger: number

      defines the trigger to process

    • Optional evt: IActionEvent

      defines the event details to be processed

    Returns void

registerActionSearch playground for registerAction

serializeSearch playground for serialize

  • 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

unregisterActionSearch playground for unregisterAction

  • unregisterAction(action: IAction): Boolean
  • Unregisters an action to this action manager

    Parameters

    • action: IAction

      defines the action to be unregistered

    Returns Boolean

    a boolean indicating whether the action has been unregistered

Static GetTriggerNameSearch playground for GetTriggerName

  • GetTriggerName(trigger: number): string
  • Get a trigger name by index

    Parameters

    • trigger: number

      defines the trigger index

    Returns string

    a trigger name

Static HasSpecificTriggerSearch playground for HasSpecificTrigger

  • 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 ParseSearch playground for Parse

  • 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

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Static property
  • Static method
  • Inherited property