Constructor
new L3D.AssetManager()
The AssetManager is constructed by the Loki initialization process.
Properties
The path where assets are found. This may be the path to the server's asset manager.
The set of scripts currently loaded by the asset manager.
Methods
add(url, asset) → Asset
Register an asset with the asset manager so it's cached for the next time it's requested with load or get.
url |
String | |
asset |
Asset |
deleteAsset(url)
Remove an asset from the cache.
url |
String |
get(url) → nullable Asset
Returns the asset cached with the given path, undefined if it hasn't been cached yet.
url |
String |
getAssetPath(url) → String
Get the full path to an asset.
url |
String |
- String
getLoaderForExtension(ext) → nullable AssetLoader
Find a AssetLoader that's associated with the given file extension.
ext |
String |
getLoaderForFilename(filename) → nullable AssetLoader
Find an AssetLoader that's associated with the given file name.
filename |
String |
has(url) → bool
Does the asset manager have an asset cached with the given path?
url |
String |
- bool
initialize(assetPath)
Registers all of the system assets
assetPath |
String |
isAssetInvalid(url) → bool
Invalid assets are assets that have been requested but couldn't be loaded, likely because the path is invalid, or there is no asset with that path.
url |
String |
- bool
true if the asset is invalid
load(url, onLoad, noCache) → nullable Asset
Load an asset from the given URL. The AssetLoader of the asset is determined by the file extension of the URL. URLs that begin with ":" are internal built-in assets.
url |
String | |
onLoad |
function | |
noCache |
bool |
registerLoader(loaderClass)
Register an AssetLoader class with the asset manager.
loaderClass |
Class |
updateAsset(id, properties)
Update the properties of the asset on the server.
id |
String | |
properties |
Object |