ClassInput & Controls@public
FlxVirtualPad
HUD-aligned collection of deterministic direction and action buttons.
ts
export declare class FlxVirtualPad extends FlxGroup<FlxVirtualButton>Constructors
ts
constructor(dpadMode?: FlxVirtualDPadMode, actionMode?: FlxVirtualActionMode, options?: FlxVirtualPadOptions)Constructs a new instance of the FlxVirtualPad class
| Parameter | Type | Description |
|---|---|---|
dpadMode | FlxVirtualDPadMode | - |
actionMode | FlxVirtualActionMode | - |
options | FlxVirtualPadOptions | - |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
A | readonly | FlxVirtualButton | null | - |
B | readonly | FlxVirtualButton | null | - |
down | readonly | FlxVirtualButton | null | - |
left | readonly | FlxVirtualButton | null | - |
right | readonly | FlxVirtualButton | null | - |
up | readonly | FlxVirtualButton | null | - |
Methods
bindActions()
ts
bindActions(actions: FlxActions, map: FlxVirtualPadActionMap): thisAdd this pad's sources to an existing keyboard/gamepad action map.
Parameters:
| Parameter | Type | Description |
|---|---|---|
actions | FlxActions | - |
map | FlxVirtualPadActionMap | - |
Returns: this
bindAxes()
ts
bindAxes(actions: FlxActions, map: FlxVirtualPadAxisMap): thisAdd horizontal/vertical scalar sources when both direction buttons exist.
Parameters:
| Parameter | Type | Description |
|---|---|---|
actions | FlxActions | - |
map | FlxVirtualPadAxisMap | - |
Returns: this
getButton()
ts
getButton(id: 'up' | 'down' | 'left' | 'right' | 'A' | 'B'): FlxVirtualButton | nullParameters:
| Parameter | Type | Description |
|---|---|---|
id | 'up' | 'down' | 'left' | 'right' | 'A' | 'B' | - |
Returns: FlxVirtualButton | null