CubeTextureAssetTask

Define a task used by AssetsManager to load cube textures

Hierarchy

Implements

Index

Constructors

constructor

Find examples in Playground
  • new CubeTextureAssetTask(name: string, url: string, extensions?: string[] | undefined, noMipmap?: boolean | undefined, files?: string[] | undefined): CubeTextureAssetTask
  • Creates a new CubeTextureAssetTask

    Parameters

    • name: string

      defines the name of the task

    • url: string

      defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)

    • Optional extensions: string[] | undefined

      defines the extensions to use to load files (["px", "py", "pz", "nx", "ny", "nz"] by default)

    • Optional noMipmap: boolean | undefined

      defines if mipmaps should not be generated (default is false)

    • Optional files: string[] | undefined

      defines the explicit list of files (undefined by default)

    Returns CubeTextureAssetTask

Properties

errorObject

Find examples in Playground
errorObject: object

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

Type declaration

  • Optional exception?: any
  • Optional message?: string

Optional extensions

Find examples in Playground
extensions: string[] | undefined

Defines the extensions to use to load files (["px", "py", "pz", "nx", "ny", "nz"] by default)

Optional files

Find examples in Playground
files: string[] | undefined

Defines the explicit list of files (undefined by default)

isCompleted

Find examples in Playground
isCompleted: boolean

Get if the task is completed

name

Find examples in Playground
name: string

Defines the name of the task

Optional noMipmap

Find examples in Playground
noMipmap: boolean | undefined

Defines if mipmaps should not be generated (default is false)

onError

Find examples in Playground
onError: function

Callback called when the task is successful

Type declaration

onSuccess

Find examples in Playground
onSuccess: function

Callback called when the task is successful

Type declaration

taskState

Find examples in Playground
taskState: AssetTaskState

Gets the current state of the task

texture

Find examples in Playground
texture: CubeTexture

Gets the loaded texture

url

Find examples in Playground
url: string

Defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)

Methods

reset

Find examples in Playground
  • reset(): void
  • Reset will set the task state back to INIT, so the next load call of the assets manager will execute this task again. This can be used with failed tasks that have the reason for failure fixed.

    Returns void

run

Find examples in Playground
  • run(scene: Scene, onSuccess: function, onError: function): void
  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: function

      is a callback called when the task is successfully executed

        • (): void
        • Returns void

    • onError: function

      is a callback called if an error occurs

        • (message?: string, exception?: any): void
        • Parameters

          • Optional message: string
          • Optional exception: any

          Returns void

    Returns void

runTask

Find examples in Playground
  • runTask(scene: Scene, onSuccess: function, onError: function): void
  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: function

      is a callback called when the task is successfully executed

        • (): void
        • Returns void

    • onError: function

      is a callback called if an error occurs

        • (message?: string, exception?: any): void
        • Parameters

          • Optional message: string
          • Optional exception: any

          Returns void

    Returns void

Generated using TypeDoc