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- Pick a release from Pause-Games/flow 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 navigation_messages from "flow.navigation.messages"
- Pick a release from Pause-Games/flow releases and add its Source code (zip) URL (or a packaged
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 environmentsmessage?:LuaMap<string, unknown> | PlainTable— The incoming Defold message payload
Returns
boolean— True when the message was handled by navigation