API

Class ImageAssetTask

Define a task used by AssetsManager to load images

Hierarchy (View Summary)

Index
image: HTMLImageElement

Gets the loaded images

name: string

Defines the name of the task

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

Callback called when the task is successful

onSuccess: (task: ImageAssetTask) => void

Callback called when the task is successful

url: string

Defines the location of the image 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