blob: 8584810704f4bec3a5b41ff10175c4a1cec77a69 (
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
42
43
44
45
46
47
48
49
50
51
52
|
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";
public static final String LOADING = "data/loading.atlas";
@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 loadLoading()
{
load(LOADING, TextureAtlas.class);
}
public void unloadLoading()
{
unload(LOADING);
}
public void loadGame()
{
load(MAP_00, Texture.class);
load(CORNER, Texture.class);
}
public void unloadGame()
{
unload(MAP_00);
unload(CORNER);
}
}
|