com.badlogic.gdx.assets.loaders.AssetLoader Java Examples

The following examples show how to use com.badlogic.gdx.assets.loaders.AssetLoader. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Utility.java    From Norii with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void loadAsset(final String assetName, final Class className, final AssetLoader loader) {
	if ((!isAssetLoaded(assetName)) && (checkValidString(assetName))) {
		if (filePathResolver.resolve(assetName).exists()) {
			assetManager.setLoader(className, loader);
			assetManager.load(assetName, className);
			assetManager.finishLoadingAsset(assetName);// block
			Gdx.app.debug(TAG, className.getSimpleName() + " loaded: " + assetName);
		} else {
			Gdx.app.debug(TAG, className.getSimpleName() + " doesn't exist: " + assetName);
		}
	}
}