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- 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_segments from "gamepush.core.segments"
- Pick a release from megalanthus/defold-gamepush releases and add its Source code (zip) URL (or a packaged
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.