Skip to Content
defold-typescript libraries
Pause-Gamesflow

Pause-Games/flow/flow.navigation.proxy

Loads and enables each Flow screen's collection proxy as the navigation stack changes.

  • 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_proxy from "flow.navigation.proxy"

Functions

attach(nav?: Flow_Navigation | undefined, opts?: Flow_ProxyAttachOptions | undefined): LuaTable

Attach the collection proxy runtime to a navigation instance. Registers "preload" and "changed" event listeners so proxies are managed automatically as screens are navigated.

When opts.sync_existing is true (the default), immediately preloads all already-registered screens with preload=true, and syncs the current active proxy if a screen is already on the stack.

Parameters

  • nav?: Flow_Navigation | undefined — The navigation module; defaults to flow/navigation/init
  • opts?: Flow_ProxyAttachOptions | undefined — Options overriding DEFAULTS

Returns

  • LuaTable — The runtime instance (call :detach() to clean up)

detach(self: LuaMap<string, unknown> | PlainTable)

Remove all navigation event listeners and clean up the runtime. Call this in your bootstrap script's final() function to prevent leaked listeners after the script is destroyed.

Parameters

  • self: LuaMap<string, unknown> | PlainTable — The runtime instance created by M.attach()

On this page