Skip to Content
defold-typescript libraries
megalanthusdefold-gamepush

megalanthus/defold-gamepush/gamepush.core.events

GamePush events: list them, join one and check whether it is active, 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_events from "gamepush.core.events"

Functions

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

Joins an event. Raises when the table is missing.

Parameters

  • parameters: Record<string, unknown> — The options for the SDK's events.join.
  • callback?: (result: unknown) => void — Receives the result.

list(): Record<string, unknown>[]

All events.

Returns

  • Record<string, unknown>[]

active_list(): Record<string, unknown>[]

The events the player is taking part in.

Returns

  • Record<string, unknown>[]

get_event(id_or_tag: string | number): Record<string, unknown>

An event's description.

Parameters

  • id_or_tag: string | number — The event's id or tag.

Returns

  • Record<string, unknown>

has(id_or_tag: string | number): boolean

Whether an event is active.

Parameters

  • id_or_tag: string | number — The event's id or tag.

Returns

  • boolean

is_joined(id_or_tag: string | number): boolean

Whether the player is taking part in an event.

Parameters

  • id_or_tag: string | number — The event's id or tag.

Returns

  • boolean

Variables

callbacks: EventsCallbacks

The event handlers.

Types

EventsCallbacks

EventsCallbacks.join?: (event: unknown) => void

The player joined an event.

EventsCallbacks.error_join?: (error: unknown) => void

Joining an event failed.

On this page