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- Pick a release from baochungit/defold-wrap 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 go_list from "wrap.go_list"
- Pick a release from baochungit/defold-wrap releases and add its Source code (zip) URL (or a packaged
Functions
new(2 overloads): GoList<K>
<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.
<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>