Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CompressedTextureLoader

Abstract base class for block based textures loader (dds, pvr, ...). This uses the FileLoader internally for loading files.

Examples

See the DDSLoader | and PVRLoader | for examples of derived classes.

Hierarchy

Index

Constructors

constructor

Properties

crossOrigin

crossOrigin: string

The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS. Default is anonymous.

default

'anonymous'

manager

The loadingManager the loader is using. Default is DefaultLoadingManager.

path

path: string

The base path from which the asset will be loaded. Default is the empty string.

default

''

requestHeader

requestHeader: {}

The request header used in HTTP request. See .setRequestHeader. Default is empty object.

default

{}

Type declaration

  • [header: string]: string

resourcePath

resourcePath: string

The base path from which additional resources like textures will be loaded. Default is the empty string.

default

''

withCredentials

withCredentials: boolean

Whether the XMLHttpRequest uses credentials. See .setWithCredentials. Default is false.

default:

false

Methods

load

  • Begin loading from url and pass the loaded texture to onLoad.

    Parameters

    • url: string

      The path or URL to the file. This can also be a Data URI.

    • onLoad: (texture: I3JS.CompressedTexture) => void

      Will be called when load completes. The argument will be the loaded texture.

    • Optional onProgress: (event: ProgressEvent<EventTarget>) => void

      Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .total and .loaded bytes. If the server does not set the Content-Length header; .total will be 0.

        • (event: ProgressEvent<EventTarget>): void
        • Parameters

          • event: ProgressEvent<EventTarget>

          Returns void

    • Optional onError: (event: ErrorEvent) => void

      Will be called when load errors.

        • (event: ErrorEvent): void
        • Parameters

          • event: ErrorEvent

          Returns void

    Returns I3JS.CompressedTexture

loadAsync

  • loadAsync(url: string, onProgress?: (event: ProgressEvent<EventTarget>) => void): Promise<I3JS.CompressedTexture>
  • Begin loading from url and pass the loaded texture to onLoad.

    Parameters

    • url: string

      The path or URL to the file. This can also be a Data URI.

    • Optional onProgress: (event: ProgressEvent<EventTarget>) => void

      Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .total and .loaded bytes. If the server does not set the Content-Length header; .total will be 0.

        • (event: ProgressEvent<EventTarget>): void
        • Parameters

          • event: ProgressEvent<EventTarget>

          Returns void

    Returns Promise<I3JS.CompressedTexture>

setCrossOrigin

setPath

setRequestHeader

setResourcePath

setWithCredentials

Generated using TypeDoc