On this page

britzl/defold-input/in.textbox

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

Functions

acquire()

release()

register(box_node_or_string: Opaque<"node"> | string, text_node_or_string: Opaque<"node"> | string, is_masked?: boolean): Opaque<"node">

Parameters

  • box_node_or_string: Opaque<"node"> | string
  • text_node_or_string: Opaque<"node"> | string
  • is_masked?: boolean

Returns

  • Opaque<"node">

unregister(node_or_string?: Opaque<"node"> | string)

Parameters

  • node_or_string?: Opaque<"node"> | string

effect(node: Opaque<"node">, scale: { x: number; y: number; })

Parameters

  • node: Opaque<"node">
  • scale: { x: number; y: number; }
    • x: number
    • y: number

text(node_or_string: Opaque<"node"> | string, text?: string): string | undefined

Parameters

  • node_or_string: Opaque<"node"> | string
  • text?: string

Returns

  • string | undefined

on_input(action_id: Hash, action: {}): boolean

Parameters

  • action_id: Hash
  • action: {}

Returns

  • boolean

Variables

TOUCH: Hash

TYPE: Hash

BACKSPACE: Hash