Skip to Content
defold-typescript libraries
megalanthusdefold-gamepush

megalanthus/defold-gamepush/gamepush.core.segments

GamePush player segments: list them and check membership, 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_segments from "gamepush.core.segments"

Functions

list(): string[]

The tags of the segments the player belongs to; empty when none.

Returns

  • string[]

has(tag: string): boolean

Whether the player belongs to a segment.

Parameters

  • tag: string — The segment's tag.

Returns

  • boolean

Variables

callbacks: SegmentsCallbacks

The event handlers.

Types

SegmentsCallbacks

SegmentsCallbacks.enter?: (segment_tag: unknown) => void

The player entered a segment.

SegmentsCallbacks.leave?: (segment_tag: unknown) => void

The player left a segment.

On this page