API

Class TextFileAssetTask

Define a task used by AssetsManager to load text content

Hierarchy (View Summary)

Index
name: string

Defines the name of the task

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

Callback called when the task is successful

onSuccess: (task: TextFileAssetTask) => void

Callback called when the task is successful

text: string

Gets the loaded text string

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