AssetsManager

This class can be used to easily import assets into a scene

see

http://doc.babylonjs.com/how_to/how_to_use_assetsmanager

Hierarchy

  • AssetsManager

Index

Constructors

constructor

  • Creates a new AssetsManager

    Parameters

    • scene: Scene

      defines the scene to work on

    Returns AssetsManager

Properties

onFinish

onFinish: function

Callback called when all tasks are processed

Type declaration

onProgress

onProgress: function

Callback called when a task is done (whatever the result is)

Type declaration

onProgressObservable

onProgressObservable: Observable<IAssetsProgressEvent>

Observable called when a task is done (whatever the result is)

onTaskError

onTaskError: function

Callback called when a task had an error

Type declaration

onTaskErrorObservable

onTaskErrorObservable: Observable<AbstractAssetTask>

Observable called when a task had an error

onTaskSuccess

onTaskSuccess: function

Callback called when a task is successful

Type declaration

onTaskSuccessObservable

onTaskSuccessObservable: Observable<AbstractAssetTask>

Observable called when all tasks are processed

onTasksDoneObservable

onTasksDoneObservable: Observable<AbstractAssetTask[]>

Observable called when a task is successful

useDefaultLoadingScreen

useDefaultLoadingScreen: boolean

Gets or sets a boolean defining if the {BABYLON.AssetsManager} should use the default loading screen

see

http://doc.babylonjs.com/how_to/creating_a_custom_loading_screen

Methods

addBinaryFileTask

  • Add a {BABYLON.BinaryFileAssetTask} to the list of active tasks

    Parameters

    • taskName: string

      defines the name of the new task

    • url: string

      defines the url of the file to load

    Returns BinaryFileAssetTask

    a new {BABYLON.BinaryFileAssetTask} object

addCubeTextureTask

  • addCubeTextureTask(taskName: string, url: string, extensions?: string[], noMipmap?: boolean, files?: string[]): CubeTextureAssetTask
  • Add a {BABYLON.CubeTextureAssetTask} to the list of active tasks

    Parameters

    • taskName: string

      defines the name of the new task

    • url: string

      defines the url of the file to load

    • Optional extensions: string[]

      defines the extension to use to load the cube map (can be null)

    • Optional noMipmap: boolean

      defines if the texture must not receive mipmaps (false by default)

    • Optional files: string[]

      defines the list of files to load (can be null)

    Returns CubeTextureAssetTask

    a new {BABYLON.CubeTextureAssetTask} object

addHDRCubeTextureTask

  • addHDRCubeTextureTask(taskName: string, url: string, size?: number, noMipmap?: boolean, generateHarmonics?: boolean, useInGammaSpace?: boolean, usePMREMGenerator?: boolean): HDRCubeTextureAssetTask
  • Add a {BABYLON.HDRCubeTextureAssetTask} to the list of active tasks

    Parameters

    • taskName: string

      defines the name of the new task

    • url: string

      defines the url of the file to load

    • Optional size: number

      defines the size you want for the cubemap (can be null)

    • Optional noMipmap: boolean

      defines if the texture must not receive mipmaps (false by default)

    • Optional generateHarmonics: boolean

      defines if you want to automatically generate (true by default)

    • Optional useInGammaSpace: boolean

      defines if the texture must be considered in gamma space (false by default)

    • Optional usePMREMGenerator: boolean

      is a reserved parameter and must be set to false or ignored

    Returns HDRCubeTextureAssetTask

    a new {BABYLON.HDRCubeTextureAssetTask} object

addImageTask

  • Add a {BABYLON.ImageAssetTask} to the list of active tasks

    Parameters

    • taskName: string

      defines the name of the new task

    • url: string

      defines the url of the file to load

    Returns ImageAssetTask

    a new {BABYLON.ImageAssetTask} object

addMeshTask

  • addMeshTask(taskName: string, meshesNames: any, rootUrl: string, sceneFilename: string): MeshAssetTask
  • Add a {BABYLON.MeshAssetTask} to the list of active tasks

    Parameters

    • taskName: string

      defines the name of the new task

    • meshesNames: any

      defines the name of meshes to load

    • rootUrl: string

      defines the root url to use to locate files

    • sceneFilename: string

      defines the filename of the scene file

    Returns MeshAssetTask

    a new {BABYLON.MeshAssetTask} object

addTextFileTask

  • Add a {BABYLON.TextFileAssetTask} to the list of active tasks

    Parameters

    • taskName: string

      defines the name of the new task

    • url: string

      defines the url of the file to load

    Returns TextFileAssetTask

    a new {BABYLON.TextFileAssetTask} object

addTextureTask

  • addTextureTask(taskName: string, url: string, noMipmap?: boolean, invertY?: boolean, samplingMode?: number): TextureAssetTask
  • Add a {BABYLON.TextureAssetTask} to the list of active tasks

    Parameters

    • taskName: string

      defines the name of the new task

    • url: string

      defines the url of the file to load

    • Optional noMipmap: boolean

      defines if the texture must not receive mipmaps (false by default)

    • Optional invertY: boolean

      defines if you want to invert Y axis of the loaded texture (false by default)

    • Optional samplingMode: number

      defines the sampling mode to use (BABYLON.Texture.TRILINEAR_SAMPLINGMODE by default)

    Returns TextureAssetTask

    a new {BABYLON.TextureAssetTask} object

load

  • Start the loading process

    Returns AssetsManager

    the current instance of the {BABYLON.AssetsManager}

reset

  • Reset the {BABYLON.AssetsManager} and remove all tasks

    Returns AssetsManager

    the current instance of the {BABYLON.AssetsManager}

Generated using TypeDoc