Class TextureLoader

Class for loading a texture.
Unlike other loaders, this one emits events instead of using predefined callbacks. So if you're interested in getting notified when things happen, you need to add listeners to the object.

Hierarchy (view full)

Constructors

Properties

DEFAULT_MATERIAL_NAME: string
crossOrigin: string
'anonymous'
withCredentials: boolean
false
path: string
''
resourcePath: string
''
requestHeader: {
    [header: string]: string;
}
{}

Methods

  • Parameters

    • url: string
    • OptionalonLoad: ((data: Texture) => void)
        • (data): void
        • Parameters

          Returns void

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

          Returns void

    • OptionalonError: ((err: unknown) => void)
        • (err): void
        • Parameters

          • err: unknown

          Returns void

    Returns Texture

  • Parameters

    • url: string
    • OptionalonProgress: ((event: ProgressEvent<EventTarget>) => void)
        • (event): void
        • Parameters

          Returns void

    Returns Promise<Texture>

  • Parameters

    • crossOrigin: string

    Returns this

  • Parameters

    • value: boolean

    Returns this

  • Parameters

    • path: string

    Returns this

  • Parameters

    • resourcePath: string

    Returns this

  • Parameters

    • requestHeader: {
          [header: string]: string;
      }
      • [header: string]: string

    Returns this