Hierarchy

  • VariableButtonConfig

Properties

buttonIndex: number

The index of the button this emulated button should controll in the Gamepad.buttons array

directions: { down?: boolean; left?: boolean; right?: boolean; up?: boolean }

What drag/movement gesture directions should result in the button value of this varaible button increasing Typically only one direction will be set to true, but you can set multiple to true if you want to

Type declaration

  • Optional down?: boolean
  • Optional left?: boolean
  • Optional right?: boolean
  • Optional up?: boolean
dragDistance: number

The distance drag gesture must go in pixels to appear as a fully pressed button: value = 1

lockTargetWhilePressed?: boolean

Should this variable button lock the cursor once a drag gesture has started, such that NO pointer/mouse/touch events are fired with that pointer on any other elements on the page unil the gesture is finished (finger leaves the screen or mouse lets go) This option also prevents this button from reacting when a press starts on another button or page element and then the pointer/touch moves over the tap target of this button while being held down.

tapTarget: HTMLElement | SVGElement

The element where a tap or mouse click must start to control this variable button. The pointer does not need to remain within this element while dragging to continue controlling the variable button as long as the mouse / touch / pointer is held down

type: variable

Generated using TypeDoc