The file:// story, split by how renderer-specific each piece is.
paths.ts resolves an asset path against the compiled data: URI map (or the dev server)
and needs no renderer at all; binary.ts caches raw bytes the same renderer-free way, for
anything (three-d's VOX loader, most directly) that wants an ArrayBuffer rather than a
decoded texture; loader.ts fetches and decodes textures through Pixi specifically. This
barrel exposes all three, so import { load, resolve } from '@datamoc/mw_games/assets' is
unchanged - but a game rendering through something else imports
@datamoc/mw_games/assets/paths or @datamoc/mw_games/assets/binary instead and pays
nothing for Pixi.
setBase(path:string):void
points dev-mode lookups at the folder assets are served from
The
file://story, split by how renderer-specific each piece is.paths.tsresolves an asset path against the compileddata:URI map (or the dev server) and needs no renderer at all;binary.tscaches raw bytes the same renderer-free way, for anything (three-d's VOX loader, most directly) that wants anArrayBufferrather than a decoded texture;loader.tsfetches and decodes textures through Pixi specifically. This barrel exposes all three, soimport { load, resolve } from '@datamoc/mw_games/assets'is unchanged - but a game rendering through something else imports@datamoc/mw_games/assets/pathsor@datamoc/mw_games/assets/binaryinstead and pays nothing for Pixi.