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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
package ch.asynk.tankontank;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import ch.asynk.tankontank.screens.LoadScreen;
public class TankOnTank extends Game
{
public AssetManager manager;
public Skin skin;
@Override
public void create ()
{
Gdx.app.setLogLevel(Gdx.app.LOG_DEBUG);
Gdx.app.debug("TankOnTank", "create() [" + Gdx.graphics.getWidth() + ";" + Gdx.graphics.getHeight() + "]");
manager = new AssetManager();
skin = new Skin(Gdx.files.internal("skin/uiskin.json"));
this.setScreen(new LoadScreen(this));
}
public void loadAssets()
{
Gdx.app.debug("TankOnTank", " load assets : " + (Gdx.app.getJavaHeap()/1024.0f) + "KB");
manager.load("images/map_a.png", Texture.class);
manager.load("images/map_b.png", Texture.class);
manager.load("images/dice.pack", TextureAtlas.class);
manager.load("images/cup.jpg", Texture.class);
manager.load("images/back.png", Texture.class);
manager.load("images/small.png", Texture.class);
manager.load("images/turn_back.png", Texture.class);
manager.load("images/turn_front.png", Texture.class);
manager.load("images/ace.png", Texture.class);
manager.load("images/ap_spent.png", Texture.class);
manager.load("images/ap_2.png", Texture.class);
manager.load("images/ap_3.png", Texture.class);
manager.load("images/ap_4.png", Texture.class);
manager.load("images/ge_atgun.png", Texture.class);
manager.load("images/ge_infantry.png", Texture.class);
manager.load("images/ge_tiger.png", Texture.class);
manager.load("images/ge_kingtiger.png", Texture.class);
manager.load("images/ge_panzer_iv.png", Texture.class);
manager.load("images/ge_panzer_iv_hq.png", Texture.class);
manager.load("images/ge_wespe.png", Texture.class);
manager.load("images/us_atgun.png", Texture.class);
manager.load("images/us_infantry.png", Texture.class);
manager.load("images/us_pershing.png", Texture.class);
manager.load("images/us_pershing_hq.png", Texture.class);
manager.load("images/us_priest.png", Texture.class);
manager.load("images/us_sherman.png", Texture.class);
manager.load("images/us_sherman_hq.png", Texture.class);
manager.load("images/us_wolverine.png", Texture.class);
}
public void unloadAssets()
{
Gdx.app.debug("TankOnTank", "unload assets : " + (Gdx.app.getJavaHeap()/1024.0f) + "KB");
manager.unload("images/map_a.png");
manager.unload("images/map_b.png");
manager.unload("images/dice.pack");
manager.unload("images/cup.jpg");
manager.unload("images/back.png");
manager.unload("images/small.png");
manager.unload("images/turn_back.png");
manager.unload("images/turn_front.png");
manager.unload("images/ace.png");
manager.unload("images/ap_spent.png");
manager.unload("images/ap_2.png");
manager.unload("images/ap_3.png");
manager.unload("images/ap_4.png");
manager.unload("images/ge_atgun.png");
manager.unload("images/ge_infantry.png");
manager.unload("images/ge_tiger.png");
manager.unload("images/ge_kingtiger.png");
manager.unload("images/ge_panzer_iv.png");
manager.unload("images/ge_panzer_iv_hq.png");
manager.unload("images/ge_wespe.png");
manager.unload("images/us_atgun.png");
manager.unload("images/us_infantry.png");
manager.unload("images/us_pershing.png");
manager.unload("images/us_pershing_hq.png");
manager.unload("images/us_priest.png");
manager.unload("images/us_sherman.png");
manager.unload("images/us_sherman_hq.png");
manager.unload("images/us_wolverine.png");
}
// @Override
// public void render ()
// {
// Gdx.gl.glClearColor(0, 0, 0, 1);
// Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
// super.render();
// }
// @Override
// public void resize(int width, int height)
// {
// Gdx.app.debug("TankOnTank", "resize(" + width + ", " + height + ")");
// super.resize(width, height);
// }
@Override
public void dispose()
{
Gdx.app.debug("TankOnTank", "dispose()");
getScreen().dispose();
}
// @Override
// public void pause()
// {
// Gdx.app.debug("TankOnTank", "pause()");
// }
// @Override
// public void resume()
// {
// Gdx.app.debug("TankOnTank", "resume()");
// }
}
|