ImageAssetTask

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

Hierarchy

Index

Constructors

constructor

Properties

errorObject

errorObject: object

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

Type declaration

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

image

image: HTMLImageElement

Gets the loaded images

isCompleted

isCompleted: boolean

Get if the task is completed

name

name: string

Defines the name of the task

onError

onError: function

Callback called when the task is successful

Type declaration

    • Parameters

      • task: ImageAssetTask
      • Optional message: string
      • Optional exception: any

      Returns void

onSuccess

onSuccess: function

Callback called when the task is successful

Type declaration

taskState

taskState: AssetTaskState

Gets the current state of the task

url

url: string

Defines the location of the image to load

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