blob: 3eadf9fb7205397b5ce854881f921a4e9c273373 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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);
}
}
|