new AssetManager()
The asset manager is the unique object for storing and loading content (audio
, image, files).
- Source:
Methods
-
addAsset({string], {string])
-
Add an asset to the list. As for sound the first to be found supported by the browser will be the only one added. You have to provide at least one supported format if you want the game to run.
Parameters:
Name Type Description {string]
pName The name of the asset to load. {FM.ObjectType]
pType The type of the asset to load. {string]
pPath The path of the asset to load. - Source:
-
areAllAssetsLoaded() → {boolean}
-
Check if all assets have been loaded.
- Source:
Returns:
Whether all assets are loaded or not.- Type
- boolean
-
assetLoaded()
-
Fired when an asset has been loaded.
- Source:
-
getAssetByName(name) → {FM.Asset}
-
Get an asset by its name.
Parameters:
Name Type Description name
String The name of the asset to retrieve. - Source:
Returns:
The asset matching the given name. Can be an FM.ImageAsset, a FM.AudioAsset or a FM.FileAsset.- Type
- FM.Asset
-
loadAssets()
-
Load all assets.
- Source: