On this page

britzl/defold-input/in.state

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 state from "in.state"

Functions

create(): StateInstance

Returns

  • StateInstance

acquire(url: Url, instance?: StateInstance)

Parameters

  • url: Url
  • instance?: StateInstance

release(url: Url, instance?: StateInstance)

Parameters

  • url: Url
  • instance?: StateInstance

is_pressed(action_id: Hash | string, instance?: StateInstance): boolean

Parameters

  • action_id: Hash | string
  • instance?: StateInstance

Returns

  • boolean

update(action_id: Hash | string, action: {}, instance?: StateInstance)

Parameters

  • action_id: Hash | string
  • action: {}
  • instance?: StateInstance

on_input(action_id: Hash | string, action: {}, instance?: StateInstance)

Parameters

  • action_id: Hash | string
  • action: {}
  • instance?: StateInstance

clear(instance?: StateInstance)

Parameters

  • instance?: StateInstance