API

Class BinaryFileAssetTask

Define a task used by AssetsManager to load binary data

Hierarchy (View Summary)

Index
data: ArrayBuffer

Gets the loaded data (as an array buffer)

name: string

Defines the name of the task

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

Callback called when the task is successful

onSuccess: (task: BinaryFileAssetTask) => void

Callback called when the task is successful

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