API

Class TextureAssetTask

Define a task used by AssetsManager to load 2D textures

Hierarchy (View Summary)

Implements

Index
  • Creates a new TextureAssetTask object

    Parameters

    • name: string

      defines the name of the task

    • url: string

      defines the location of the file to load

    • OptionalnoMipmapOrOptions: boolean | ITextureCreationOptions

      defines if mipmap should not be generated (default is false) or the creation options to use

    • invertY: boolean = true

      defines if texture must be inverted on Y axis (default is true)

    • samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE

      defines the sampling mode to use (default is Texture.TRILINEAR_SAMPLINGMODE)

    Returns TextureAssetTask

invertY: boolean = true

[true] Defines if texture must be inverted on Y axis (default is true)

name: string

Defines the name of the task

noMipmapOrOptions?: boolean | ITextureCreationOptions

Defines if mipmap should not be generated (default is false) or the creation options to use

onError: (task: TextureAssetTask, message?: string, exception?: any) => void

Callback called when the task is successful

onSuccess: (task: TextureAssetTask) => void

Callback called when the task is successful

samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE

[3] Defines the sampling mode to use (default is Texture.TRILINEAR_SAMPLINGMODE)

texture: Texture

Gets the loaded texture

url: string

Defines the location of the file to load

  • get errorObject(): { exception?: any; message?: string }

    Gets the current error object (if task is in error)

    Returns { exception?: any; message?: string }

  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: () => void

      is a callback called when the task is successfully executed

    • onError: (message?: string, exception?: any) => void

      is a callback called if an error occurs

    Returns void

  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: () => void

      is a callback called when the task is successfully executed

    • onError: (message?: string, exception?: any) => void

      is a callback called if an error occurs

    Returns void