PIXI.CompressedTextureLoader
class CompressedTextureLoader implements {PIXI.ILoaderPlugin}
Loader plugin for handling compressed textures for all platforms.
Constructor
new PIXI.CompressedTextureLoader() → {}
Summary
Properties from CompressedTextureLoader
Partial<CompressedTextureExtensions> |
Map of available texture extensions. |
{ [P in keyof keyof] }: number |
Map of available texture formats. |
Methods from CompressedTextureLoader
void |
Called after a compressed-textures manifest is loaded. |
Public Properties
static textureExtensions: Partial<CompressedTextureExtensions>
Map of available texture extensions.
static textureFormats: { [P in keyof keyof] }: number
Map of available texture formats.
Public Methods
static use(resource: PIXI.LoaderResource, next: (...args: any[]) => void) → {void}
Called after a compressed-textures manifest is loaded.
This will then load the correct compression format for the device. Your manifest should adhere to the following schema:
import { INTERNAL_FORMATS } from '@pixi/constants';
type CompressedTextureManifest = {
textures: Array<{ src: string, format?: keyof INTERNAL_FORMATS}>,
cacheID: string;
};
This is an example of a .json manifest file
{
"cacheID":"asset",
"textures":[
{ "src":"asset.fallback.png" },
{ "format":"COMPRESSED_RGBA_S3TC_DXT5_EXT", "src":"asset.s3tc.ktx" },
{ "format":"COMPRESSED_RGBA8_ETC2_EAC", "src":"asset.etc.ktx" },
{ "format":"RGBA_PVRTC_4BPPV1_IMG", "src":"asset.pvrtc.ktx" }
]
}
Name | Type | Description |
---|---|---|
resource | PIXI.LoaderResource | |
next | (...args: any[]) => void |
Type | Description |
---|---|
void |