Skip to content

Interface: SpriteSequenceOptions ​

Ergonomic wrapper over Vite-style import.meta.glob results for sprite sequences, particle frame sets, sound banks — anything where a folder's contents map to an ordered array at build time.

The build-system contract: callers pass the result of import.meta.glob(pattern, { eager, query:'?url', import:'default' }) (or the equivalent for other bundlers). Each value is the final bundled URL of one asset, the key is its source path. The helper sorts keys so frame order is stable and deterministic, then returns the URLs in that order.

Why sort the keys, not the URLs: bundlers hash filenames (e.g. frame_01-AbC.webp), so sorting URLs would scramble frame order. Source paths like frame_01.webp / frame_02.webp sort naturally.

Typical usage in game code: const frames = LoadSpriteSequence( import.meta.glob('./assets/Star_Particle/*.webp', { eager : true, query : '?url', import : 'default' }), ); // → ['/assets/Star_Particle_PNG_00000-X.webp', '/assets/..._00001-Y.webp', ...]

The returned URLs are exactly what the renderer's asset loader expects — pass them to assetLoader.Load([{ id, type:'texture', src: frames[i] }]) or wrap with BuildSpriteFrameClipsFromSheet / LoadSpriteFrameClip for animation use.

Extended by ​

Properties ​

PropertyTypeDescription
filter?(key, url) => booleanFilter applied AFTER sort — return true to keep. Useful for skipping .DS_Store etc. when a glob accidentally matches them.
sort?(a, b) => numberOptional comparator for keys. Defaults to natural-numeric sort so frame_2.webp sorts before frame_10.webp (lexicographic would put _10 first).

© 2026 PlayAdGentic