Skip to Content
defold-typescript libraries
megalanthusdefold-gamepush

megalanthus/defold-gamepush/gamepush.core.reactions

GamePush reactions: set and remove a player reaction, with their events.

  • GitHub: megalanthus/defold-gamepush — pinned to v1.4.1
    1. Pick a release from megalanthus/defold-gamepush 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 core_reactions from "gamepush.core.reactions"

Functions

set(parameters: Record<string, unknown>, callback?: (result: unknown) => void)

Sets a reaction. Raises when the table is missing.

Parameters

  • parameters: Record<string, unknown> — The reaction: its entityType, entityId and reactionType.
  • callback?: (result: unknown) => void — Receives the result.

unset(parameters: Record<string, unknown>, callback?: (result: unknown) => void)

Removes a reaction. Raises when the table is missing.

Parameters

  • parameters: Record<string, unknown> — The reaction, in the shape set takes.
  • callback?: (result: unknown) => void — Receives the result.

Variables

callbacks: ReactionsCallbacks

The reaction event handlers.

Types

ReactionsCallbacks

ReactionsCallbacks.set?: (result: unknown) => void

A reaction was set.

ReactionsCallbacks.unset?: (result: unknown) => void

A reaction was removed.

ReactionsCallbacks.set_error?: (error: unknown) => void

Setting a reaction failed.

ReactionsCallbacks.unset_error?: (error: unknown) => void

Removing a reaction failed.

ReactionsCallbacks.event_set?: (result: unknown) => void

A reaction was set on an entity.

ReactionsCallbacks.event_unset?: (result: unknown) => void

A reaction was removed from an entity.

On this page