RuntimeAssetSource
Defined in: runtimeAssets.ts:31
How a target supplies scene assets to the single Assets channel, built from
canonical parts instead of a bespoke provider:
backend— canonical fetch (text/binary, incl. KTX2 containers)decodePixels— platform image → RGBA (URL<img>can’t reachestella:/// WeChat package files / inlined data-URLs);flipis applied on upload viacreateTextureFromPixels, so decoders return top-first and ignore itresolveRef— ref → resolved (extension-bearing) path; must run before theTextureLoaderKTX2 extension check, so uuid/manifest lookup lives HERE, not inbackend.resolveUrl. Omit for identity. (Signature declared locally, not imported from TextureLoader — that module imports from this one, so importing back would cycle.)
Properties
Section titled “Properties”backend
Section titled “backend”backend:
Backend
Defined in: runtimeAssets.ts:32
Methods
Section titled “Methods”decodePixels()
Section titled “decodePixels()”decodePixels(
path,flip):Promise<{height:number;pixels:Uint8Array;width:number; }>
Defined in: runtimeAssets.ts:33
Parameters
Section titled “Parameters”string
boolean
Returns
Section titled “Returns”Promise<{ height: number; pixels: Uint8Array; width: number; }>
listAssetPaths()?
Section titled “listAssetPaths()?”
optionallistAssetPaths():string[]
Defined in: runtimeAssets.ts:51
Every asset path this realm ships (logical, extension-bearing). Powers
content-driven discovery of assets NO scene references — locale string
tables (.eslocale), which Text binds by KEY, not path. Optional: a
realm without it simply can’t auto-load such assets (the runtime loader
warns when a scene needs them).
Returns
Section titled “Returns”string[]
resolveAddress()?
Section titled “resolveAddress()?”
optionalresolveAddress(ref):string|null
Defined in: runtimeAssets.ts:43
The LOGICAL source path a ref was authored at (e.g. assets/spine/hero.atlas),
even after a content-addressed build renamed the physical file to a hash. A
loader that resolves a SIBLING by name — a Spine atlas naming its page PNG
relative to itself — needs the logical directory, which resolveRef (a build
path) has lost. Optional: a realm that stages under logical paths has nothing
to recover, and a caller falls back to the resolved path.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string | null
resolveRef()?
Section titled “resolveRef()?”
optionalresolveRef(ref):string
Defined in: runtimeAssets.ts:34
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string