Class: GamepadInputRelay
Defined in: livelink.js/sources/inputs/GamepadInputRelay.ts:131
It serves as an interface between high level gamepad input representations and the server.
Methods
setAxis()
setAxis(params: {
axis: GamepadAxisType;
value: number;
}): void;
Defined in: livelink.js/sources/inputs/GamepadInputRelay.ts:176
Set the value of a single axis.
Parameters
Parameter | Type | Description |
---|---|---|
params | { axis : GamepadAxisType ; value : number ; } | |
params.axis | GamepadAxisType | The axis to set. |
params.value | number | The value to set. 0 means the axis is centered. |
Returns
void
setJoystick()
setJoystick(params: {
joystick: GamepadJoystickType;
value: [number, number];
}): void;
Defined in: livelink.js/sources/inputs/GamepadInputRelay.ts:190
Set the values of the two axes composing a joystick.
Parameters
Parameter | Type | Description |
---|---|---|
params | { joystick : GamepadJoystickType ; value : [number , number ]; } | |
params.joystick | GamepadJoystickType | The joystick to set. |
params.value | [number , number ] | The values to set for the joystick. The first number is the horizontal axis and the second number is the vertical axis. 0 means the joystick is centered. |
Returns
void
setButton()
setButton(params: {
button: GamepadButtonType;
isPressed: boolean;
}): void;
Defined in: livelink.js/sources/inputs/GamepadInputRelay.ts:202
Set the value of a single button.
Parameters
Parameter | Type | Description |
---|---|---|
params | { button : GamepadButtonType ; isPressed : boolean ; } | |
params.button | GamepadButtonType | The button to set. |
params.isPressed | boolean | A boolean indicating whether the button is pressed (true) or not (false). |
Returns
void
setButtons()
setButtons(params: {
buttons: boolean[];
}): void;
Defined in: livelink.js/sources/inputs/GamepadInputRelay.ts:216
Set the values of all buttons.
Parameters
Parameter | Type | Description |
---|---|---|
params | { buttons : boolean []; } | |
params.buttons | boolean [] | An array of buttons value, sorted following the indexes referenced by the GamepadButton enum. |
Returns
void
resetInput()
resetInput(): void;
Defined in: livelink.js/sources/inputs/GamepadInputRelay.ts:236
Reset all the input values to their default state.
Returns
void