Manages the asset loading (images, fonts, audios, videos).
this.assetManager.loadImage("image.png");this.assetManager.loadAudio("audio.ogg");this.assetManager.loadVideo("video.mp4");this.assetManager.loadFont("custom-font", "custom-font.ttf");const imageElement = this.assetManager.getImage("image.png");const audioElement = this.assetManager.getAudio("audio.ogg");const videoElement = this.assetManager.getVideo("video.mp4");const fontFace = this.assetManager.getFont("custom-font");if (this.assetManager.getAssetsLoaded()) { // do something when assets are loaded} Copy
this.assetManager.loadImage("image.png");this.assetManager.loadAudio("audio.ogg");this.assetManager.loadVideo("video.mp4");this.assetManager.loadFont("custom-font", "custom-font.ttf");const imageElement = this.assetManager.getImage("image.png");const audioElement = this.assetManager.getAudio("audio.ogg");const videoElement = this.assetManager.getVideo("video.mp4");const fontFace = this.assetManager.getFont("custom-font");if (this.assetManager.getAssetsLoaded()) { // do something when assets are loaded}
Returns TRUE if the assets are loaded
TRUE or FALSE
Retrieves an audio asset
The asset URL
The HTML Audio element
Retrieves a font asset
The font family name
The Font element
Retrieves an image asset
The HTML Image element
Retrieves a video asset
The HTML Video element
Loads an audio asset
The HTML Audio element created
Loads a font asset
The FontFace object created
Loads an image asset
The HTML Image element created
Loads an video asset
The HTML Video element created
Manages the asset loading (images, fonts, audios, videos).
Example