# Class TextureLoader

- Defined in lib/five/texture/loader.ts:11

##### Index

### Constructors

constructor

### Methods

loadCubeTexture
loadTexture

## Constructors

### constructor

- new TextureLoader(): TextureLoader

  #### Returns TextureLoader

## Methods

### loadCubeTexture

- loadCubeTexture(
  sources: Record<CubeFace, string>,
  options: {
  fetcher: Fetcher;
  format?: PixelFormat;
  generateMipmaps?: boolean;
  imageURL?: {
  options?: ImageURLOptions;
  transform?: (source: string, options: ImageURLOptions) => string;
  };
  magFilter?: TextureFilter;
  minFilter?: TextureFilter;
  timeout?: number;
  viaAjax?: boolean;
  wrapS?: Wrapping;
  wrapT?: Wrapping;
  },
  onLoad?: (response: NetworkResponse<CubeTexture, NetWorkMeta[]>) => void,
  onError?: (error: Error) => void,
  onProgress?: (percent: number) => void,
  renderer: WebGLRenderer,
  ): Promise<NetworkResponse<CubeTexture, NetWorkMeta[]>>

  #### Parameters

  - sources: Record<CubeFace, string>
  - options: {
    fetcher: Fetcher;
    format?: PixelFormat;
    generateMipmaps?: boolean;
    imageURL?: {
    options?: ImageURLOptions;
    transform?: (source: string, options: ImageURLOptions) => string;
    };
    magFilter?: TextureFilter;
    minFilter?: TextureFilter;
    timeout?: number;
    viaAjax?: boolean;
    wrapS?: Wrapping;
    wrapT?: Wrapping;
    }
  - onLoad: (response: NetworkResponse<CubeTexture, NetWorkMeta[]>) => void = noop
  - onError: (error: Error) => void = noop
  - onProgress: (percent: number) => void = noop
  - renderer: WebGLRenderer

  #### Returns Promise<NetworkResponse<CubeTexture, NetWorkMeta[]>>

  - Defined in lib/five/texture/loader.ts:138

### loadTexture

- loadTexture(
  source: string,
  options: {
  encoding?: TextureEncoding;
  fetcher: Fetcher;
  flipY?: boolean;
  format?: PixelFormat;
  generateMipmaps?: boolean;
  imageURL?: {
  options?: ImageURLOptions;
  transform?: (source: string, options: ImageURLOptions) => string;
  };
  magFilter?: TextureFilter;
  maxSize?: Vector2;
  minFilter?: TextureFilter;
  timeout?: number;
  viaAjax?: boolean;
  wrapS?: Wrapping;
  wrapT?: Wrapping;
  },
  onLoad?: (response: NetworkResponse<Texture>) => void,
  onError?: (error: Error) => void,
  onProgress?: (percent: number) => void,
  renderer?: WebGLRenderer,
  ): Promise<NetworkResponse<Texture>>

  #### Parameters

  - source: string
  - options: {
    encoding?: TextureEncoding;
    fetcher: Fetcher;
    flipY?: boolean;
    format?: PixelFormat;
    generateMipmaps?: boolean;
    imageURL?: {
    options?: ImageURLOptions;
    transform?: (source: string, options: ImageURLOptions) => string;
    };
    magFilter?: TextureFilter;
    maxSize?: Vector2;
    minFilter?: TextureFilter;
    timeout?: number;
    viaAjax?: boolean;
    wrapS?: Wrapping;
    wrapT?: Wrapping;
    }
  - onLoad: (response: NetworkResponse<Texture>) => void = noop
  - onError: (error: Error) => void = noop
  - onProgress: (percent: number) => void = noop
  - `Optional` renderer: WebGLRenderer

  #### Returns Promise<NetworkResponse<Texture>>

  - Defined in lib/five/texture/loader.ts:13