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

Find examples in Playground
  • Creates a new AssetsManager

    Parameters

    • scene: Scene

      defines the scene to work on

    Returns AssetsManager

Properties

onFinish

Find examples in Playground
onFinish: function

Callback called when all tasks are processed

Type declaration

onProgress

Find examples in Playground
onProgress: function

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

Type declaration

onProgressObservable

Find examples in Playground
onProgressObservable: Observable<IAssetsProgressEvent>

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

onTaskError

Find examples in Playground
onTaskError: function

Callback called when a task had an error

Type declaration

onTaskErrorObservable

Find examples in Playground
onTaskErrorObservable: Observable<AbstractAssetTask>

Observable called when a task had an error

onTaskSuccess

Find examples in Playground
onTaskSuccess: function

Callback called when a task is successful

Type declaration

onTaskSuccessObservable

Find examples in Playground
onTaskSuccessObservable: Observable<AbstractAssetTask>

Observable called when all tasks are processed

onTasksDoneObservable

Find examples in Playground
onTasksDoneObservable: Observable<AbstractAssetTask[]>

Observable called when a task is successful

useDefaultLoadingScreen

Find examples in Playground
useDefaultLoadingScreen: boolean

Gets or sets a boolean defining if the AssetsManager should use the default loading screen

see

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

Methods

addBinaryFileTask

Find examples in Playground
  • Add a 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 BinaryFileAssetTask object

addCubeTextureTask

Find examples in Playground
  • addCubeTextureTask(taskName: string, url: string, extensions?: string[], noMipmap?: boolean, files?: string[]): CubeTextureAssetTask
  • Add a 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 CubeTextureAssetTask object

addHDRCubeTextureTask

Find examples in Playground
  • addHDRCubeTextureTask(taskName: string, url: string, size: number, noMipmap?: boolean, generateHarmonics?: boolean, gammaSpace?: boolean, reserved?: boolean): HDRCubeTextureAssetTask
  • Add a 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

    • 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 gammaSpace: boolean

      specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)

    • Optional reserved: boolean

      Internal use only

    Returns HDRCubeTextureAssetTask

    a new HDRCubeTextureAssetTask object

addImageTask

Find examples in Playground
  • Add a 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 ImageAssetTask object

addMeshTask

Find examples in Playground
  • addMeshTask(taskName: string, meshesNames: any, rootUrl: string, sceneFilename: string): MeshAssetTask
  • Add a 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 MeshAssetTask object

addTextFileTask

Find examples in Playground
  • Add a 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 TextFileAssetTask object

addTextureTask

Find examples in Playground
  • addTextureTask(taskName: string, url: string, noMipmap?: boolean, invertY?: boolean, samplingMode?: number): TextureAssetTask
  • Add a 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 TextureAssetTask object

load

Find examples in Playground
  • Start the loading process

    Returns AssetsManager

    the current instance of the AssetsManager

removeTask

Find examples in Playground
  • Remove a task from the assets manager.

    Parameters

    Returns void

reset

Find examples in Playground
  • Reset the AssetsManager and remove all tasks

    Returns AssetsManager

    the current instance of the AssetsManager

Generated using TypeDoc