CubeTextureAssetTask

Define a task used by {BABYLON.AssetsManager} to load cube textures

Hierarchy

Implements

Index

Constructors

constructor

  • 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

errorObject: object

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

Type declaration

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

extensions

extensions: string[] | undefined

Defines the extensions to use to load files (["_px", "_py", "_pz", "_nx", "_ny", "_nz"] by default)

files

files: string[] | undefined

Defines the explicit list of files (undefined by default)

isCompleted

isCompleted: boolean

Get if the task is completed

name

name: string

Defines the name of the task

noMipmap

noMipmap: boolean | undefined

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

onError

onError: function

Callback called when the task is successful

Type declaration

onSuccess

onSuccess: function

Callback called when the task is successful

Type declaration

taskState

taskState: AssetTaskState

Gets the current state of the task

texture

texture: CubeTexture

Gets the loaded texture

url

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

run

  • 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

  • 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