dynamic-loader-plugin
Version:
Dynamic asset loader for Phaser 3 with priority-based loading
27 lines (26 loc) • 663 B
TypeScript
export type AssetType = "image" | "spritesheet" | "audio" | "json" | "atlas";
export interface BaseAsset {
key: string;
type: AssetType;
frameConfig?: {
frameWidth: number;
frameHeight?: number;
};
}
export interface NormalAsset extends BaseAsset {
type: "image" | "spritesheet" | "audio" | "json";
path: string;
}
export interface AtlasAsset extends BaseAsset {
type: "atlas";
imagePath: string;
jsonPath: string;
}
export type Asset = NormalAsset | AtlasAsset;
export interface SceneData {
priority: number;
assets: Asset[];
}
export interface AssetManifest {
scenes: Record<string, SceneData>;
}