Skip to Content
defold-typescript libraries
baochungitdefold-wrap

baochungit/defold-wrap/wrap.go_list

Wraps several game objects at once. new takes urls, or names paired with urls, and returns a table holding one wrap.go wrapper per url or name.

  • GitHub: baochungit/defold-wrap — pinned to 1.1.0
    1. Pick a release from baochungit/defold-wrap 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 go_list from "wrap.go_list"

Functions

new(2 overloads): GoList<K>

  1. <const K extends string>(data: readonly K[])

    Wraps the game object at each url, keyed by the url.

    Parameters

    • data: readonly K[] — The game object urls.
  2. <K extends string>(data: Record<K, SceneGameObjectAddress | Hash | Url>)

    Wraps each game object, keyed by its name. A Lua table mixing urls and named entries has no TypeScript literal, so name every entry, a url under its own string.

    Parameters

    • data: Record<K, SceneGameObjectAddress | Hash | Url> — Each name, paired with a game object url.

Returns

  • GoList<K>

Types

type GoList<K extends string> = { readonly [P in K]: Go; }

On this page