Controls
| Kind | class |
| Package | backend |
| Full name | backend.Controls |
| Source | source/backend/Controls.hx |
| Extends | FlxActionSet |
A list of actions that a player would invoke via some input device. Uses FlxActions to funnel various inputs to a single action.
Public fields
| Name | Type | Static | Default | Notes |
|---|---|---|---|---|
gamepadsAdded | Array<Int> | no | [] | — |
keyboardScheme | — | no | KeyboardScheme.None | — |
UI_UP | Bool | no | — | property (get, never) |
UI_LEFT | Bool | no | — | property (get, never) |
UI_RIGHT | Bool | no | — | property (get, never) |
UI_DOWN | Bool | no | — | property (get, never) |
UI_UP_P | Bool | no | — | property (get, never) |
UI_LEFT_P | Bool | no | — | property (get, never) |
UI_RIGHT_P | Bool | no | — | property (get, never) |
UI_DOWN_P | Bool | no | — | property (get, never) |
UI_UP_R | Bool | no | — | property (get, never) |
UI_LEFT_R | Bool | no | — | property (get, never) |
UI_RIGHT_R | Bool | no | — | property (get, never) |
UI_DOWN_R | Bool | no | — | property (get, never) |
NOTE_UP | Bool | no | — | property (get, never) |
NOTE_LEFT | Bool | no | — | property (get, never) |
NOTE_RIGHT | Bool | no | — | property (get, never) |
NOTE_DOWN | Bool | no | — | property (get, never) |
NOTE_UP_P | Bool | no | — | property (get, never) |
NOTE_LEFT_P | Bool | no | — | property (get, never) |
NOTE_RIGHT_P | Bool | no | — | property (get, never) |
NOTE_DOWN_P | Bool | no | — | property (get, never) |
NOTE_UP_R | Bool | no | — | property (get, never) |
NOTE_LEFT_R | Bool | no | — | property (get, never) |
NOTE_RIGHT_R | Bool | no | — | property (get, never) |
NOTE_DOWN_R | Bool | no | — | property (get, never) |
BOT_ENERGY_P | Bool | no | — | property (get, never) |
ACCEPT | Bool | no | — | property (get, never) |
ACCEPT_P | Bool | no | — | property (get, never) |
BACK | Bool | no | — | property (get, never) |
PAUSE | Bool | no | — | property (get, never) |
RESET | Bool | no | — | property (get, never) |
instance | Controls | yes | — | — |
trackedInputsUI | Array<FlxActionInput> | no | [] | — |
trackedInputsNOTES | Array<FlxActionInput> | no | [] | — |
Public methods
new (constructor)
function new(name, scheme = None)
| Parameter | Type | Default |
|---|---|---|
name | Dynamic | — |
scheme (optional) | Dynamic | None |
addButtonNOTES
function addButtonNOTES(action:FlxActionDigital, button:FlxButton, state:FlxInputState):Void
| Parameter | Type | Default |
|---|---|---|
action | FlxActionDigital | — |
button | FlxButton | — |
state | FlxInputState | — |
addButtonUI
function addButtonUI(action:FlxActionDigital, button:FlxButton, state:FlxInputState):Void
| Parameter | Type | Default |
|---|---|---|
action | FlxActionDigital | — |
button | FlxButton | — |
state | FlxInputState | — |
setHitBox
function setHitBox(Hitbox:FlxHitbox):Void
| Parameter | Type | Default |
|---|---|---|
Hitbox | FlxHitbox | — |
setVirtualPadUI
function setVirtualPadUI(VirtualPad:FlxVirtualPad, DPad:FlxDPadMode, Action:FlxActionMode):Void
| Parameter | Type | Default |
|---|---|---|
VirtualPad | FlxVirtualPad | — |
DPad | FlxDPadMode | — |
Action | FlxActionMode | — |
setVirtualPadNOTES
function setVirtualPadNOTES(VirtualPad:FlxVirtualPad, DPad:FlxDPadMode, Action:FlxActionMode):Void
| Parameter | Type | Default |
|---|---|---|
VirtualPad | FlxVirtualPad | — |
DPad | FlxDPadMode | — |
Action | FlxActionMode | — |
removeVirtualControlsInput
function removeVirtualControlsInput(Tinputs:Array<FlxActionInput>):Void
| Parameter | Type | Default |
|---|---|---|
Tinputs | Array<FlxActionInput> | — |
checkByName
function checkByName(name:Action):Bool
inline
| Parameter | Type | Default |
|---|---|---|
name | Action | — |
getDialogueName
function getDialogueName(action:FlxActionDigital):String
| Parameter | Type | Default |
|---|---|---|
action | FlxActionDigital | — |
getDialogueNameFromToken
function getDialogueNameFromToken(token:String):String
| Parameter | Type | Default |
|---|---|---|
token | String | — |
replaceBinding
function replaceBinding(control:Control, device:Device, ?toAdd:Int, ?toRemove:Int)
| Parameter | Type | Default |
|---|---|---|
control | Control | — |
device | Device | — |
toAdd (optional) | Int | — |
toRemove (optional) | Int | — |
copyFrom
function copyFrom(controls:Controls, ?device:Device)
| Parameter | Type | Default |
|---|---|---|
controls | Controls | — |
device (optional) | Device | — |
copyTo
inline function copyTo(controls:Controls, ?device:Device)
| Parameter | Type | Default |
|---|---|---|
controls | Controls | — |
device (optional) | Device | — |
bindKeys
function bindKeys(control:Control, keys:Array<FlxKey>)
Sets all actions that pertain to the binder to trigger when the supplied keys are used. If binder is a literal you can inline this
| Parameter | Type | Default |
|---|---|---|
control | Control | — |
keys | Array<FlxKey> | — |
unbindKeys
function unbindKeys(control:Control, keys:Array<FlxKey>)
| Parameter | Type | Default |
|---|---|---|
control | Control | — |
keys | Array<FlxKey> | — |
setKeyboardScheme
function setKeyboardScheme(scheme:KeyboardScheme, reset = true)
| Parameter | Type | Default |
|---|---|---|
scheme | KeyboardScheme | — |
reset (optional) | Dynamic | true |
addGamepad
function addGamepad(id:Int, ?buttonMap:Map<Control, Array<FlxGamepadInputID>>):Void
| Parameter | Type | Default |
|---|---|---|
id | Int | — |
buttonMap (optional) | Map<Control, Array<FlxGamepadInputID>> | — |
removeGamepad
function removeGamepad(deviceID:Int = FlxInputDeviceID.ALL):Void
| Parameter | Type | Default |
|---|---|---|
deviceID (optional) | Int | FlxInputDeviceID.ALL |
addDefaultGamepad
function addDefaultGamepad(id):Void
| Parameter | Type | Default |
|---|---|---|
id | Dynamic | — |
bindButtons
function bindButtons(control:Control, id, buttons)
Sets all actions that pertain to the binder to trigger when the supplied keys are used. If binder is a literal you can inline this
| Parameter | Type | Default |
|---|---|---|
control | Control | — |
id | Dynamic | — |
buttons | Dynamic | — |
unbindButtons
function unbindButtons(control:Control, gamepadID:Int, buttons)
Sets all actions that pertain to the binder to trigger when the supplied keys are used. If binder is a literal you can inline this
| Parameter | Type | Default |
|---|---|---|
control | Control | — |
gamepadID | Int | — |
buttons | Dynamic | — |
getInputsFor
function getInputsFor(control:Control, device:Device, ?list:Array<Int>):Array<Int>
| Parameter | Type | Default |
|---|---|---|
control | Control | — |
device | Device | — |
list (optional) | Array<Int> | — |
removeDevice
function removeDevice(device:Device)
| Parameter | Type | Default |
|---|---|---|
device | Device | — |
Internals
Private / internal members
| Field | Type | Static |
|---|---|---|
_ui_up | — | no |
_ui_left | — | no |
_ui_right | — | no |
_ui_down | — | no |
_ui_upP | — | no |
_ui_leftP | — | no |
_ui_rightP | — | no |
_ui_downP | — | no |
_ui_upR | — | no |
_ui_leftR | — | no |
_ui_rightR | — | no |
_ui_downR | — | no |
_note_up | — | no |
_note_left | — | no |
_note_right | — | no |
_note_down | — | no |
_note_upP | — | no |
_note_leftP | — | no |
_note_rightP | — | no |
_note_downP | — | no |
_note_upR | — | no |
_note_leftR | — | no |
_note_rightR | — | no |
_note_downR | — | no |
_bot_energyP | — | no |
_accept | — | no |
_acceptP | — | no |
_back | — | no |
_pause | — | no |
_reset | — | no |
byName | Map<String, FlxActionDigital> | no |
| Method |
|---|
inline function get_UI_UP() |
inline function get_UI_LEFT() |
inline function get_UI_RIGHT() |
inline function get_UI_DOWN() |
inline function get_UI_UP_P() |
inline function get_UI_LEFT_P() |
inline function get_UI_RIGHT_P() |
inline function get_UI_DOWN_P() |
inline function get_UI_UP_R() |
inline function get_UI_LEFT_R() |
inline function get_UI_RIGHT_R() |
inline function get_UI_DOWN_R() |
inline function get_NOTE_UP() |
inline function get_NOTE_LEFT() |
inline function get_NOTE_RIGHT() |
inline function get_NOTE_DOWN() |
inline function get_NOTE_UP_P() |
inline function get_NOTE_LEFT_P() |
inline function get_NOTE_RIGHT_P() |
inline function get_NOTE_DOWN_P() |
inline function get_NOTE_UP_R() |
inline function get_NOTE_LEFT_R() |
inline function get_NOTE_RIGHT_R() |
inline function get_NOTE_DOWN_R() |
inline function get_BOT_ENERGY_P() |
inline function get_ACCEPT() |
inline function get_ACCEPT_P() |
inline function get_BACK() |
inline function get_PAUSE() |
inline function get_RESET() |
override function update() |
function getActionFromControl(control:Control):FlxActionDigital |
static function init():Void |
function forEachBound(control:Control, func:FlxActionDigital->FlxInputState->Void) |
function mergeKeyboardScheme(scheme:KeyboardScheme):Void |
static inline function addKeys(action:FlxActionDigital, keys:Array<FlxKey>, state:FlxInputState) |
static function removeKeys(action:FlxActionDigital, keys:Array<FlxKey>) |
function removeKeyboard() |
inline function addGamepadLiteral(id:Int, ?buttonMap:Map<Control, Array<FlxGamepadInputID>>):Void |
static inline function addButtons(action:FlxActionDigital, buttons:Array<FlxGamepadInputID>, state, id) |
static function removeButtons(action:FlxActionDigital, gamepadID:Int, buttons:Array<FlxGamepadInputID>) |
static function isDevice(input:FlxActionInput, device:Device) |
static inline function isGamepad(input:FlxActionInput, deviceID:Int) |