Skip to Content
defold-typescript libraries
MaratGilyazov

MaratGilyazov/def_taptic_engine/taptic_engine

Haptic feedback through the iOS Taptic Engine: impact, notification and selection events.

  • GitHub: MaratGilyazov/def_taptic_engine — pinned to v1.2
    1. Pick a release from MaratGilyazov/def_taptic_engine 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 taptic_engine from "taptic_engine"

Functions

isSupported(): boolean

Reports whether the device supports the Taptic Engine.

Returns

  • boolean — true when haptic feedback is available.

impact(style: number)

Plays an impact haptic.

Parameters

  • style: number — One of IMPACT_LIGHT, IMPACT_MEDIUM or IMPACT_HEAVY.

notification(type: number)

Plays a notification haptic.

Parameters

  • type: number — One of NOTIFICATION_SUCCESS, NOTIFICATION_WARNING or NOTIFICATION_ERROR.

selection()

Plays a selection-change haptic.

Variables

IMPACT_LIGHT: number

Light impact style, for {@link taptic_engine.impact}.

IMPACT_MEDIUM: number

Medium impact style, for {@link taptic_engine.impact}.

IMPACT_HEAVY: number

Heavy impact style, for {@link taptic_engine.impact}.

NOTIFICATION_SUCCESS: number

Success notification type, for {@link taptic_engine.notification}.

NOTIFICATION_WARNING: number

Warning notification type, for {@link taptic_engine.notification}.

NOTIFICATION_ERROR: number

Error notification type, for {@link taptic_engine.notification}.

On this page