-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStartScreen.java
More file actions
81 lines (56 loc) · 1.61 KB
/
StartScreen.java
File metadata and controls
81 lines (56 loc) · 1.61 KB
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
package com.game1;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
public class StartScreen extends ApplicationAdapter implements Screen{
final Game1 game;
OrthographicCamera camera;
public StartScreen(final Game1 game) {
this.game = game;
camera = new OrthographicCamera();
camera.setToOrtho(false, 1900, 1080);
}
@Override
public void show() {
// TODO Auto-generated method stub
}
@Override
public void render(float delta) {
Gdx.gl.glClearColor(0.5f, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
camera.update();
game.batch.setProjectionMatrix(camera.combined);
game.batch.begin();
game.batch.draw(game.frontimg, 0, 0);
game.font.draw(game.batch, "Durs Game", 1900/2, 1080/2 + 300, 0, 9, 200, 6, false);
game.font.draw(game.batch, "Press to continue", 1900/2 - 250, 1080/2 + 100);
game.batch.end();
//game.setScreen(new GameScreen(game));
if(Gdx.input.isTouched()) {
game.setScreen(new GameScreen(game));
this.dispose();
}
}
@Override
public void resize(int width, int height) {
// TODO Auto-generated method stub
}
@Override
public void pause() {
// TODO Auto-generated method stub
}
@Override
public void resume() {
// TODO Auto-generated method stub
}
@Override
public void hide() {
// TODO Auto-generated method stub
}
@Override
public void dispose() {
}
}