Skip to content

RuntimeAssetSource

Defined in: runtime/runtimeAssets.ts:33

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: runtime/runtimeAssets.ts:34

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

Defined in: runtime/runtimeAssets.ts:35

string

boolean

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


optional listAssetPaths(): string[]

Defined in: runtime/runtimeAssets.ts:53

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: runtime/runtimeAssets.ts:45

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: runtime/runtimeAssets.ts:36

string

string


optional spineCulling(skeleton, atlas): { height: number; width: number; x: number; y: number; } | undefined

Defined in: runtime/runtimeAssets.ts:69

The rectangle no pose of this spine PAIR leaves, in the skeleton’s own space. Both refs, since an atlas the promise was not recorded against inherits nothing; a realm without this certifies nothing.

string

string

{ height: number; width: number; x: number; y: number; } | undefined


optional textureImportSettings(ref): ParsedTextureImportSettings | undefined

Defined in: runtime/runtimeAssets.ts:65

Per-texture import settings (filter/wrap/sRGB and the 9-slice border) for a ref. These belong to the ASSET, not to any scene that uses it, which is why they arrive through the realm’s source alongside resolveRef rather than being copied into every scene that references the texture — a copy in the scene goes stale the moment the .meta changes.

Optional: a realm without it renders with loader defaults. Each realm has the data already — the editor from its asset database, a cooked build from the importer block the cook copies into the ship manifest.

string

ParsedTextureImportSettings | undefined