Skip to content

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 reach estella:// / WeChat package files / inlined data-URLs); flip is applied on upload via createTextureFromPixels, so decoders return top-first and ignore it
  • resolveRef — ref → resolved (extension-bearing) path; must run before the TextureLoader KTX2 extension check, so uuid/manifest lookup lives HERE, not in backend.resolveUrl. Omit for identity. (Signature declared locally, not imported from TextureLoader — that module imports from this one, so importing back would cycle.)

backend: Backend

Defined in: runtimeAssets.ts:32

decodePixels(path, flip): Promise<{ height: number; pixels: Uint8Array; width: number; }>

Defined in: runtimeAssets.ts:33

string

boolean

Promise<{ height: number; pixels: Uint8Array; width: number; }>


optional listAssetPaths(): 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).

string[]


optional resolveAddress(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.

string

string | null


optional resolveRef(ref): string

Defined in: runtimeAssets.ts:34

string

string