/
githubmirror
/
pixijs
Обзор
Документация
Войти
/
githubmirror
/
pixijs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/assets/cache/parsers/cacheTextureArray.ts
33 строки
916 B
Zyie
chore: add standard/advanced tags to documentation (#11448)
03 июн 2025, 10:12
Не верифицирован
03 июн 2025, 10:12
7d91234
Код
Авторство
О чём код?
import { ExtensionType } from '../../../extensions/Extensions'; import { Texture } from '../../../rendering/renderers/shared/texture/Texture'; import type { CacheParser } from '../CacheParser'; /** * Returns an object of textures from an array of textures to be cached * @category assets * @internal */ export const cacheTextureArray: CacheParser<Texture[]> = { extension: { type: ExtensionType.CacheParser, name: 'cacheTextureArray', }, test: (asset: any[]) => Array.isArray(asset) && asset.every((t) => t instanceof Texture), getCacheableAssets: (keys: string[], asset: Texture[]) => { const out: Record<string, Texture> = {}; keys.forEach((key: string) => { asset.forEach((item: Texture, i: number) => { out[key + (i === 0 ? '' : i + 1)] = item; }); }); return out; } };