Skip to main content

InputManager Class

Description:

  The input manager class.

InputManager.JoyStickType

Type: Enumeration.

Description:

  The enumeration defining the joystick types.

Signature:

enum JoyStickType
"Left"
"Right"
end

InputManager.TriggerState

Type: Enumeration.

Description:

  The trigger state enumeration.

Signature:

enum TriggerState

-- Currently no input state has been acquired.
"None"

-- An event that initiates the evaluation of the trigger has occurred. For example, the first press in a "hold" trigger will call the "Started" state once.
"Started"

-- The trigger is still being processed. For example, when a button is pressed, before reaching the specified duration, the "hold" action is in an ongoing state. Depending on the trigger, this event will trigger every time it updates during the evaluation of the action after receiving an input value.
"Ongoing"

-- The evaluation process of the trigger has been completed.
"Completed"

-- The trigger has been canceled. For example, the user releases the button before the "hold" action is triggered.
"Canceled"
end

CreateManager

Type: Function.

Description:

  Creates an input manager with the specified input contexts.

Signature:

CreateManager: function(contexts: {InputContext}): InputManager

Parameters:

ParameterTypeDescription
contexts{InputContext}The input contexts to be created.

Returns:

Return TypeDescription
InputManagerThe input manager.

CreateDPad

Type: Function.

Description:

  Creates a virtual directional pad (D-pad) for input.

Signature:

CreateDPad: function(props: DPadProps): Node.Type

Parameters:

ParameterTypeDescription
propsDPadPropsThe properties of the D-pad.

Returns:

Return TypeDescription
NodeThe D-pad node.

CreateJoyStick

Type: Function.

Description:

  Creates a virtual joystick (L, LS or R, RS) for input.

Signature:

CreateJoyStick: function(props: JoyStickProps): Node.Type

Parameters:

ParameterTypeDescription
propsJoyStickPropsThe properties of the joystick.

Returns:

Return TypeDescription
NodeThe joystick node.

CreateButtonPad

Type: Function.

Description:

  Creates a virtual button pad (A, B, X, Y) for input.

Signature:

CreateButtonPad: function(props: ButtonPadProps): Node.Type

Parameters:

ParameterTypeDescription
propsButtonPadPropsThe properties of the button pad.

Returns:

Return TypeDescription
NodeThe button pad node.

CreateControlPad

Type: Function.

Description:

  Creates a virtual control pad (Start and Back buttons) for input.

Signature:

CreateControlPad: function(props: ControlPadProps): Node.Type

Parameters:

ParameterTypeDescription
propsControlPadPropsThe properties of the control pad.

Returns:

Return TypeDescription
NodeThe control pad node.

CreateTriggerPad

Type: Function.

Description:

  Creates a virtual trigger pad (LB, LT, RB, RT) for input.

Signature:

CreateTriggerPad: function(props: TriggerPadProps): Node.Type

Parameters:

ParameterTypeDescription
propsTriggerPadPropsThe properties of the trigger pad.

Returns:

Return TypeDescription
NodeThe trigger pad node.

CreateGamePad

Type: Function.

Description:

  Creates a virtual gamepad for input.

Signature:

CreateGamePad: function(props: GamePadProps): Node.Type

Parameters:

ParameterTypeDescription
propsGamePadPropsThe properties of the gamepad.

Returns:

Return TypeDescription
NodeThe gamepad node.