Class: CompressedTextureLoader

PIXI.CompressedTextureLoader

Loader plugin for handling compressed textures for all platforms.

new PIXI.CompressedTextureLoader

Implements

  • {PIXI.ILoaderPlugin}

Members

PIXI.CompressedTextureLoader.textureExtensions Partial<CompressedTextureExtensions> static

Map of available texture extensions.

PIXI.CompressedTextureLoader.textureFormats { [P in keyof keyof] }: number static

Map of available texture formats.

Methods

PIXI.CompressedTextureLoader.use (resource, next) void static

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