ca.blarg.gdx.tilemap3d.assets.prefabs.TilePrefabLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gdx-tilemap3d Show documentation
Show all versions of gdx-tilemap3d Show documentation
Library to handle management and rendering of a game world composed of 3D "tiles" arranged in a uniform 3D grid, via libGDX.
The newest version!
package ca.blarg.gdx.tilemap3d.assets.prefabs;
import ca.blarg.gdx.tilemap3d.prefabs.TilePrefab;
import com.badlogic.gdx.assets.AssetDescriptor;
import com.badlogic.gdx.assets.AssetLoaderParameters;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader;
import com.badlogic.gdx.assets.loaders.FileHandleResolver;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.Array;
public class TilePrefabLoader extends AsynchronousAssetLoader {
public static class TilePrefabParameters extends AssetLoaderParameters {
}
JsonTilePrefab definition;
TilePrefab prefab;
public TilePrefabLoader(FileHandleResolver resolver) {
super(resolver);
}
@Override
public Array getDependencies(String fileName, FileHandle file, TilePrefabParameters parameter) {
definition = TilePrefabJsonLoader.load(file);
return null;
}
@Override
public void loadAsync(AssetManager manager, String fileName, FileHandle file, TilePrefabParameters parameter) {
prefab = TilePrefabJsonLoader.create(file, definition, manager);
}
@Override
public TilePrefab loadSync(AssetManager manager, String fileName, FileHandle file, TilePrefabParameters parameter) {
return prefab;
}
}