On this page

britzl/defold-input/in.gesture

Cross-platform input handling for Defold: keyboard, mouse, gamepad, touch, and on-screen controls.

  • GitHub: britzl/defold-input — pinned to 2fe3aed
    1. Pick a release from britzl/defold-input releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Run bunx @defold-typescript/cli resolve to materialize its types.
    3. Import it under a namespace alias of your choice:
      import * as gesture from "in.gesture"

Functions

create(settings?: { action_id?: string; tap_threshold?: number; double_tap_interval?: number; swipe_threshold?: number; swipe_time?: number; long_press_time?: number; multi_touch?: boolean; }): GestureInstance

Parameters

  • settings?: { action_id?: string; tap_threshold?: number; double_tap_interval?: number; swipe_threshold?: number; swipe_time?: number; long_press_time?: number; multi_touch?: boolean; }
    • action_id?: string
    • tap_threshold?: number
    • double_tap_interval?: number
    • swipe_threshold?: number
    • swipe_time?: number
    • long_press_time?: number
    • multi_touch?: boolean

Returns

  • GestureInstance

on_input(this: any, action_id: Hash, action: {}): DetectedGestures

Parameters

  • this: any
  • action_id: Hash
  • action: {}

Returns

  • DetectedGestures

Variables

SETTINGS: { action_id: Hash; tap_threshold: number; double_tap_interval: number; swipe_threshold: number; swipe_time: number; long_press_time: number; multi_touch: boolean; }