| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final ObjectMap | |
| pack-priv final ObjectMap | |
| pack-priv final ObjectMap | |
| pack-priv final AsyncExecutor | |
| pack-priv final ObjectSet | |
| pack-priv AssetErrorListener | |
| pack-priv int | |
| pack-priv final ObjectMap | |
| pack-priv final Array | |
| pack-priv Logger | |
| pack-priv int | |
| pack-priv final FileHandleResolver | |
| pack-priv final Array | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | AssetManager(FileHandleResolver resolver, boolean
whether to add the default loaders defaultLoaders)Creates a new AssetManager with optionally all default loaders. |
| Modifier and Type | Method and Description |
|---|---|
| protected <T> void | |
| private void | |
| public void | |
| public synchronized boolean | |
| public synchronized boolean | |
| public synchronized <T> boolean | |
| public void | dispose()
Implements com. Disposes all assets in the manager and stops all asynchronous loading. |
| public void | |
| public <T> T | finishLoadingAsset(AssetDescriptor<T>
the AssetDescriptor of the asset assetDesc)Blocks until the specified asset is loaded. |
| public <T> T | finishLoadingAsset(String
the file name (interpretation depends on fileName)AssetLoader)Blocks until the specified asset is loaded. |
| public synchronized <T> T | |
| public synchronized <T> T | |
| public synchronized <T> T | |
| public synchronized <T> T | |
| public synchronized <T> T | |
| public synchronized <T> Array | |
| public synchronized <T> String | |
| public synchronized Array | |
| public synchronized Class | |
| public synchronized Array | getDependencies(String fileName)
Returns: the dependencies of an asset or null if the asset has no dependencies. |
| public synchronized String | |
| public FileHandleResolver | Returns: the file handle resolver which this AssetManager usesReturns the |
| public synchronized int | |
| public <T> AssetLoader | |
| public <T> AssetLoader | Returns: The loader capable of loading the type and filename, or null if none existsThe type of the loader to get type, final String The filename of the asset to get a loader for, or null to get the default loader fileName)Returns the loader for the given type and the specified filename. |
| public Logger | |
| public synchronized float | |
| public synchronized int | |
| public synchronized int | |
| private void | handleTaskError(Throwable t)
Handles a runtime/loading error in |
| private void | |
| pack-priv synchronized void | |
| private synchronized void | |
| public synchronized boolean | |
| public synchronized boolean | isLoaded(AssetDescriptor<T>
the AssetDescriptor of the asset assetDesc)Returns: whether the asset is loaded |
| public synchronized boolean | |
| public synchronized boolean | |
| public synchronized <T> void | load(String
the file name (interpretation depends on fileName, Class<T> AssetLoader)the type of the asset. type)Adds the given asset to the loading queue of the AssetManager. |
| public synchronized <T> void | load(String
the file name (interpretation depends on fileName, Class<T> AssetLoader)the type of the asset. type, AssetLoaderParameters<T> parameters for the AssetLoader. parameter)Adds the given asset to the loading queue of the AssetManager. |
| public synchronized void | load(AssetDescriptor<T>
the desc)AssetDescriptorAdds the given asset to the loading queue of the AssetManager. |
| private void | |
| public synchronized void | setErrorListener(AssetErrorListener
the listener or null listener)Sets an |
| public synchronized <T, P extends AssetLoaderParameters | setLoader(Class<T>
the type of the asset type, AssetLoader<T, P> the loader loader)Sets a new |
| public synchronized <T, P extends AssetLoaderParameters | setLoader(Class<T>
the type of the asset type, String the suffix the filename must have for this loader to be used or null to specify the default loader. suffix, AssetLoader<T, P> the loader loader)Sets a new |
| public void | |
| public synchronized void | |
| protected void | taskFailed(AssetDescriptor<T> assetDesc, RuntimeException ex)
Called when a task throws an exception during loading. |
| public synchronized void | |
| public synchronized boolean | |
| public boolean | Returns: true if all loading is finished.Updates the AssetManager continuously for the specified number of milliseconds, yielding the CPU to the loading thread between updates. |
| private boolean | Returns: true if the asset is loaded or the task was cancelled.Updates the current task on the top of the task stack. |
| assetDependencies | back to summary |
|---|---|
| pack-priv final ObjectMap<String, Array<String>> assetDependencies | |
| assets | back to summary |
|---|---|
| pack-priv final ObjectMap<Class<T>, ObjectMap<String, AssetManager. | |
| assetTypes | back to summary |
|---|---|
| pack-priv final ObjectMap<String, Class<T>> assetTypes | |
| executor | back to summary |
|---|---|
| pack-priv final AsyncExecutor executor | |
| injected | back to summary |
|---|---|
| pack-priv final ObjectSet<String> injected | |
| listener | back to summary |
|---|---|
| pack-priv AssetErrorListener listener | |
| loaded | back to summary |
|---|---|
| pack-priv int loaded | |
| loaders | back to summary |
|---|---|
| pack-priv final ObjectMap<Class<T>, ObjectMap<String, AssetLoader<T, P extends AssetLoaderParameters<T>>>> loaders | |
| loadQueue | back to summary |
|---|---|
| pack-priv final Array<AssetDescriptor<T>> loadQueue | |
| log | back to summary |
|---|---|
| pack-priv Logger log | |
| peakTasks | back to summary |
|---|---|
| pack-priv int peakTasks | |
| resolver | back to summary |
|---|---|
| pack-priv final FileHandleResolver resolver | |
| tasks | back to summary |
|---|---|
| pack-priv final Array<AssetLoadingTask> tasks | |
| toLoad | back to summary |
|---|---|
| pack-priv int toLoad | |
| AssetManager | back to summary |
|---|---|
| public AssetManager() Creates a new AssetManager with all default loaders. | |
| AssetManager | back to summary |
|---|---|
| public AssetManager(FileHandleResolver resolver) Creates a new AssetManager with all default loaders. | |
| AssetManager | back to summary |
|---|---|
| public AssetManager(FileHandleResolver resolver, boolean defaultLoaders) Creates a new AssetManager with optionally all default loaders. If you don't add the default loaders then you do have to manually add the loaders you need, including any loaders they might depend on.
| |
| addAsset | back to summary |
|---|---|
| protected <T> void addAsset(final String fileName, Class<T> type, T asset) Adds an asset to this AssetManager | |
| addTask | back to summary |
|---|---|
| private void addTask(AssetDescriptor<T> assetDesc) Adds a | |
| clear | back to summary |
|---|---|
| public void clear() Clears and disposes all assets and the preloading queue. | |
| contains | back to summary |
|---|---|
| public synchronized boolean contains(String fileName) Returns true if an asset with the specified name is loading, queued to be loaded, or has been loaded. | |
| contains | back to summary |
|---|---|
| public synchronized boolean contains(String fileName, Class<T> type) Returns true if an asset with the specified name and type is loading, queued to be loaded, or has been loaded. | |
| containsAsset | back to summary |
|---|---|
public synchronized <T> boolean containsAsset(T asset)
| |
| dispose | back to summary |
|---|---|
| public void dispose() Implements com. Disposes all assets in the manager and stops all asynchronous loading.
| |
| finishLoading | back to summary |
|---|---|
| public void finishLoading() Blocks until all assets are loaded. | |
| finishLoadingAsset | back to summary |
|---|---|
| public <T> T finishLoadingAsset(AssetDescriptor<T> assetDesc) Blocks until the specified asset is loaded.
| |
| finishLoadingAsset | back to summary |
|---|---|
| public <T> T finishLoadingAsset(String fileName) Blocks until the specified asset is loaded.
| |
| get | back to summary |
|---|---|
public synchronized <T> T get(String fileName)
| |
| get | back to summary |
|---|---|
public synchronized <T> T get(String fileName, Class<T> type)
| |
| get | back to summary |
|---|---|
| public synchronized <T> T get(String fileName, boolean required) | |
| get | back to summary |
|---|---|
| public synchronized <T> T get(String fileName, Class<T> type, boolean required) | |
| get | back to summary |
|---|---|
public synchronized <T> T get(AssetDescriptor<T> assetDescriptor)
| |
| getAll | back to summary |
|---|---|
| public synchronized <T> Array | |
| getAssetFileName | back to summary |
|---|---|
public synchronized <T> String getAssetFileName(T asset)
| |
| getAssetNames | back to summary |
|---|---|
| public synchronized Array | |
| getAssetType | back to summary |
|---|---|
public synchronized Class
| |
| getDependencies | back to summary |
|---|---|
| public synchronized Array | |
| getDiagnostics | back to summary |
|---|---|
public synchronized String getDiagnostics()
| |
| getFileHandleResolver | back to summary |
|---|---|
| public FileHandleResolver getFileHandleResolver() Returns the
| |
| getLoadedAssets | back to summary |
|---|---|
public synchronized int getLoadedAssets()
| |
| getLoader | back to summary |
|---|---|
| public <T> AssetLoader Returns the default loader for the given type.
| |
| getLoader | back to summary |
|---|---|
| public <T> AssetLoader Returns the loader for the given type and the specified filename. If no loader exists for the specific filename, the default loader for that type is returned.
| |
| getLogger | back to summary |
|---|---|
public Logger getLogger()
| |
| getProgress | back to summary |
|---|---|
public synchronized float getProgress()
| |
| getQueuedAssets | back to summary |
|---|---|
public synchronized int getQueuedAssets()
| |
| getReferenceCount | back to summary |
|---|---|
| public synchronized int getReferenceCount(String fileName) Returns the reference count of an asset. | |
| handleTaskError | back to summary |
|---|---|
| private void handleTaskError(Throwable t) Handles a runtime/loading error in | |
| incrementRefCountedDependencies | back to summary |
|---|---|
| private void incrementRefCountedDependencies(String parent) | |
| injectDependencies | back to summary |
|---|---|
| pack-priv synchronized void injectDependencies(String parentAssetFilename, Array<AssetDescriptor<T>> dependendAssetDescs) | |
| injectDependency | back to summary |
|---|---|
| private synchronized void injectDependency(String parentAssetFilename, AssetDescriptor<T> dependendAssetDesc) | |
| isFinished | back to summary |
|---|---|
| public synchronized boolean isFinished() Returns true when all assets are loaded. Can be called from any thread but note | |
| isLoaded | back to summary |
|---|---|
public synchronized boolean isLoaded(AssetDescriptor<T> assetDesc)
| |
| isLoaded | back to summary |
|---|---|
public synchronized boolean isLoaded(String fileName)
| |
| isLoaded | back to summary |
|---|---|
public synchronized boolean isLoaded(String fileName, Class<T> type)
| |
| load | back to summary |
|---|---|
| public synchronized <T> void load(String fileName, Class<T> type) Adds the given asset to the loading queue of the AssetManager.
| |
| load | back to summary |
|---|---|
| public synchronized <T> void load(String fileName, Class<T> type, AssetLoaderParameters<T> parameter) Adds the given asset to the loading queue of the AssetManager.
| |
| load | back to summary |
|---|---|
| public synchronized void load(AssetDescriptor<T> desc) Adds the given asset to the loading queue of the AssetManager.
| |
| nextTask | back to summary |
|---|---|
| private void nextTask() Removes a task from the loadQueue and adds it to the task stack. If the asset is already loaded (which can happen if it was a dependency of a previously loaded asset) its reference count will be increased. | |
| setErrorListener | back to summary |
|---|---|
| public synchronized void setErrorListener(AssetErrorListener listener) Sets an
| |
| setLoader | back to summary |
|---|---|
| public synchronized <T, P extends AssetLoaderParameters Sets a new
| |
| setLoader | back to summary |
|---|---|
| public synchronized <T, P extends AssetLoaderParameters Sets a new
| |
| setLogger | back to summary |
|---|---|
| public void setLogger(Logger logger) | |
| setReferenceCount | back to summary |
|---|---|
| public synchronized void setReferenceCount(String fileName, int refCount) Sets the reference count of an asset. | |
| taskFailed | back to summary |
|---|---|
| protected void taskFailed(AssetDescriptor<T> assetDesc, RuntimeException ex) Called when a task throws an exception during loading. The default implementation rethrows the exception. A subclass may supress the default implementation when loading assets where loading failure is recoverable. | |
| unload | back to summary |
|---|---|
| public synchronized void unload(String fileName) Removes the asset and all its dependencies, if they are not used by other assets.
| |
| update | back to summary |
|---|---|
| public synchronized boolean update() Updates the AssetManager for a single task. Returns if the current task is still being processed or there are no tasks, otherwise it finishes the current task and starts the next task.
| |
| update | back to summary |
|---|---|
| public boolean update(int millis) Updates the AssetManager continuously for the specified number of milliseconds, yielding the CPU to the loading thread
between updates. This may block for less time if all loading tasks are complete. This may block for more time if the portion
of a single task that happens in the GL thread takes a long time. On GWT, updates for a single task instead (see
| |
| updateTask | back to summary |
|---|---|
| private boolean updateTask() Updates the current task on the top of the task stack.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| object | back to summary |
|---|---|
| pack-priv Object object | |
| refCount | back to summary |
|---|---|
| pack-priv int refCount | |
| RefCountedContainer | back to summary |
|---|---|
| pack-priv RefCountedContainer() | |