Class AssetsManager
Hierarchy
- AssetsManager
Index
Constructors
Properties
Methods
Constructors
constructor
Creates a new AssetsManager
Parameters
Optional scene: Scene
defines the scene to work on
Returns AssetsManager
Properties
auto Hide LoadingUISearch playground for autoHideLoadingUI
Gets or sets a boolean defining if the AssetsManager should automatically hide the loading screen when all assets have been downloaded. If set to false, you need to manually call in hideLoadingUI() once your scene is ready.
on FinishSearch playground for onFinish
Type declaration
Callback called when all tasks are processed
Parameters
tasks: AbstractAssetTask[]
Returns void
on ProgressSearch playground for onProgress
Type declaration
Callback called when a task is done (whatever the result is)
Parameters
remainingCount: number
totalCount: number
task: AbstractAssetTask
Returns void
on Progress ObservableSearch playground for onProgressObservable
Observable called when a task is done (whatever the result is)
on Task ErrorSearch playground for onTaskError
Type declaration
Callback called when a task had an error
Parameters
task: AbstractAssetTask
Returns void
on Task Error ObservableSearch playground for onTaskErrorObservable
Observable called when a task had an error
on Task SuccessSearch playground for onTaskSuccess
Type declaration
Callback called when a task is successful
Parameters
task: AbstractAssetTask
Returns void
on Task Success ObservableSearch playground for onTaskSuccessObservable
Observable called when all tasks are processed
on Tasks Done ObservableSearch playground for onTasksDoneObservable
Observable called when all tasks were executed
use Default Loading ScreenSearch playground for useDefaultLoadingScreen
Gets or sets a boolean defining if the AssetsManager should use the default loading screen
Methods
add Binary File TaskSearch playground for addBinaryFileTask
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
add Container TaskSearch playground for addContainerTask
Add a ContainerAssetTask 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 | File
defines the filename of the scene file or the File itself
Optional extension: string
defines the extension to use to load the file
Returns ContainerAssetTask
a new ContainerAssetTask object
add Cube Texture TaskSearch playground for addCubeTextureTask
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)
Optional prefiltered: boolean
defines the prefiltered texture option (default is false)
Returns CubeTextureAssetTask
a new CubeTextureAssetTask object
add Equi Rectangular Cube Texture Asset TaskSearch playground for addEquiRectangularCubeTextureAssetTask
Add a EquiRectangularCubeTextureAssetTask 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 gammaSpace: boolean
Specifies if the texture will be used in gamma or linear space (the PBR material requires those textures in linear space, but the standard material would require them in Gamma space)
Returns EquiRectangularCubeTextureAssetTask
a new EquiRectangularCubeTextureAssetTask object
addHDRCube Texture TaskSearch playground for addHDRCubeTextureTask
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
add Image TaskSearch playground for addImageTask
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
add Mesh TaskSearch playground for addMeshTask
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 | File
defines the filename of the scene file or the File itself
Optional extension: string
defines the extension to use to load the file
Returns MeshAssetTask
a new MeshAssetTask object
add Text File TaskSearch playground for addTextFileTask
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
add Texture TaskSearch playground for addTextureTask
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 (Texture.TRILINEAR_SAMPLINGMODE by default)
Returns TextureAssetTask
a new TextureAssetTask object
loadSearch playground for load
Start the loading process
Returns AssetsManager
the current instance of the AssetsManager
load AsyncSearch playground for loadAsync
Start the loading process as an async operation
Returns Promise<void>
a promise returning the list of failed tasks
remove TaskSearch playground for removeTask
Remove a task from the assets manager.
Parameters
task: AbstractAssetTask
the task to remove
Returns void
resetSearch playground for reset
Reset the AssetsManager and remove all tasks
Returns AssetsManager
the current instance of the AssetsManager
This class can be used to easily import assets into a scene
https://doc.babylonjs.com/how_to/how_to_use_assetsmanager