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- Pick a release from megalanthus/defold-gamepush releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as core_reactions from "gamepush.core.reactions"
- Pick a release from megalanthus/defold-gamepush releases and add its Source code (zip) URL (or a packaged
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: itsentityType,entityIdandreactionType.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 shapesettakes.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.