Class: Axis1dAction
Defined in: input/actions/axis-1d-action.ts:9
An action that represents a 1-dimensional axis input, such as a gamepad trigger or mouse scroll.
Implements
InputActionResettable
Constructors
Constructor
new Axis1dAction(
name,inputGroup,actionResetType):Axis1dAction
Defined in: input/actions/axis-1d-action.ts:28
Creates a new Axis1dAction.
Parameters
name
string
The name of the action.
inputGroup
string
The input group this action belongs to.
actionResetType
ActionResetType = actionResetTypes.zero
The type of reset behavior for this action. Defaults to actionResetTypes.zero.
Returns
Axis1dAction
Properties
inputGroup
inputGroup:
string
Defined in: input/actions/axis-1d-action.ts:17
The input group this action belongs to.
Implementation of
InputAction.inputGroup
name
readonlyname:string
Defined in: input/actions/axis-1d-action.ts:10
The name of the action.
Implementation of
InputAction.name
valueChangeEvent
readonlyvalueChangeEvent:ParameterizedForgeEvent<number>
Defined in: input/actions/axis-1d-action.ts:16
Event that is raised whenever the axis value changes. The new value is passed as a parameter to the event listeners.
Accessors
value
Get Signature
get value():
number
Defined in: input/actions/axis-1d-action.ts:50
Gets the current value of the axis, ranging from -1 to 1.
Returns
number
Methods
reset()
reset():
void
Defined in: input/actions/axis-1d-action.ts:43
Resets the object to its initial state.
Returns
void
Implementation of
set()
set(
value):void
Defined in: input/actions/axis-1d-action.ts:55
Sets the current value of the axis, ranging from -1 to 1.
Parameters
value
number
Returns
void