Skip to content

Documentation / @debuffjp/input / TouchStickOptions

Interface: TouchStickOptions ​

Defined in: touch.ts:23

A position in logical units. A negative value counts from the far edge: { x: -32, y: -32 } is 32 units in from the bottom-right corner, so the layout holds when the game's size changes (scale: "expand").

Extends ​

Properties ​

deadzone? ​

optional deadzone?: number

Defined in: touch.ts:31

How far (0 to 1) the knob must move before a direction counts as held. Default 0.3.


radius? ​

optional radius?: number

Defined in: touch.ts:20

Touch radius. Default 24 for the stick, 16 for a button.

Inherited from ​

TouchSpot.radius


x ​

x: number

Defined in: touch.ts:17

Inherited from ​

TouchSpot.x


y ​

y: number

Defined in: touch.ts:18

Inherited from ​

TouchSpot.y


zone? ​

optional zone?: [number, number, number, number]

Defined in: touch.ts:29

Where a thumb may land to grab the stick, as [x, y, width, height] (negative x and y count from the far edge, like a spot). With a zone the stick is floating: it centres wherever the thumb lands in it. Without one it stays at x, y and takes touches within twice its radius.