Talos docs

TouchBindingDoc

Since 0.6

A touch source: a screen region (normalised 0..1, origin top left) and what a finger in it does.

Plain text

Signature

export interface TouchBindingDoc {
  /** What a finger in the region does: `stick` and `drag` are axes, `button` and `tap` are buttons. */
  mode: "stick" | "drag" | "button" | "tap"
  /** The region, normalised 0..1 of the screen with the origin at the top left. */
  region: { x: number; y: number; w: number; h: number }
  /** `stick` only: measure from the region's centre instead of where the finger landed. Default false. */
  fixed?: boolean
  /** Whether `region` is relative to the platform's safe area rather than the whole screen. Default true. */
  safeArea?: boolean
}

Import: import type { TouchBindingDoc } from "@argus/gameplay"

Members

MemberSignatureDescription
modemode: "stick" | "drag" | "button" | "tap"What a finger in the region does: stick and drag are axes, button and tap are buttons.
regionregion: { x: number; y: number; w: number; h: number }The region, normalised 0..1 of the screen with the origin at the top left.
fixedfixed?: booleanstick only: measure from the region's centre instead of where the finger landed. Default false.
safeAreasafeArea?: booleanWhether region is relative to the platform's safe area rather than the whole screen. Default true.