summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/zproject/Assets.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/zproject/Assets.java')
-rw-r--r--core/src/ch/asynk/zproject/Assets.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/core/src/ch/asynk/zproject/Assets.java b/core/src/ch/asynk/zproject/Assets.java
new file mode 100644
index 0000000..3eadf9f
--- /dev/null
+++ b/core/src/ch/asynk/zproject/Assets.java
@@ -0,0 +1,41 @@
+package ch.asynk.zproject;
+
+import com.badlogic.gdx.assets.AssetManager;
+import com.badlogic.gdx.utils.Disposable;
+import com.badlogic.gdx.graphics.Texture;
+import com.badlogic.gdx.graphics.g2d.TextureAtlas;
+
+public class Assets extends AssetManager implements Disposable
+{
+ public static final String CORNER = "data/corner.png";
+ public static final String MAP_00 = "data/map_00.png";
+
+ @Override public void dispose()
+ {
+ ZProject.debug("diagnostics:\n" + getDiagnostics() );
+ clear();
+ super.dispose();
+ }
+
+ public Texture getTexture(String assetName)
+ {
+ return get(assetName, Texture.class);
+ }
+
+ public TextureAtlas getAtlas(String assetName)
+ {
+ return get(assetName, TextureAtlas.class);
+ }
+
+ public void loadGame()
+ {
+ load(MAP_00, Texture.class);
+ load(CORNER, Texture.class);
+ }
+
+ public void unloadGame()
+ {
+ unload(MAP_00);
+ unload(CORNER);
+ }
+}