Skip to Content
defold-typescript libraries
Pause-Gamesflow

Pause-Games/flow/flow.navigation.messages

Routes Flow's navigation messages, such as push, pop and replace, to the navigation stack.

  • GitHub: Pause-Games/flow — pinned to 1.0.0
    1. Pick a release from Pause-Games/flow 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 navigation_messages from "flow.navigation.messages"

Functions

on_message(message_id: Hash | string, message?: LuaMap<string, unknown> | PlainTable): boolean

Map of all supported message ids keyed by operation name. Message id for navigation.push — payload: {id, params?, options?} Message id for navigation.pop — payload: {result?, options?} Message id for navigation.replace — payload: {id, params?, options?} Message id for navigation.reset — payload: {id, params?, options?} Message id for navigation.back — payload: {result?, options?} Message id for navigation.invalidate — no payload required Handle an incoming Defold message and dispatch it to the navigation module. Returns true when the message was a recognized navigation message and was handled. Returns false for all other messages so callers can chain additional handlers.

Supported message payloads: PUSH/REPLACE/RESET: { id = "screen_id", params = {}, options = {} } POP/BACK: { result = {}, options = {} } INVALIDATE: no payload needed

Parameters

  • message_id: Hash | string — The incoming Defold message id hash, or raw string in test environments
  • message?: LuaMap<string, unknown> | PlainTable — The incoming Defold message payload

Returns

  • boolean — True when the message was handled by navigation

On this page