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>
static textureExtensions

Map of available texture extensions.

{ [P in keyof keyof] }: number
static textureFormats

Map of available texture formats.

Methods from CompressedTextureLoader

void
static use(resource: PIXI.LoaderResource, next: (...args: any[]) => void)

Called after a compressed-textures manifest is loaded.

Public Properties


textureExtensions CompressedTextureLoader.ts:165
static textureExtensions: Partial<CompressedTextureExtensions>

Map of available texture extensions.

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

Map of available texture formats.

Public Methods


use CompressedTextureLoader.ts:52
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" }
  ]
}
Parameters:
Name Type Description
resource PIXI.LoaderResource
next (...args: any[]) => void
Returns:
Type Description
void

Powered by webdoc!