-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyGame2.java
More file actions
37 lines (32 loc) · 1.02 KB
/
Copy pathMyGame2.java
File metadata and controls
37 lines (32 loc) · 1.02 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
import com.badlogic.gdx.Application;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.mygdx.game.screens.MainMenuScreen;
import com.mygdx.game.tools.GameCamera;
public class MyGame2 extends Game {
public SpriteBatch batch;
public static final int WIDTH = 480;
public static final int HEIGHT = 720;
public boolean isMobile = false;
public com.razi.game.tools.GameCamera cam;
@Override
public void create () {
batch = new SpriteBatch();
cam = new com.razi.game.tools.GameCamera(WIDTH , HEIGHT);
if (Gdx.app.getType() == Application.ApplicationType.Android || Gdx.app.getType() == Application.ApplicationType.iOS){
isMobile = true;
}
this.setScreen(new com.razi.game.screens.MainMenuScreen(this));
}
@Override
public void render () {
batch.setProjectionMatrix(cam.combined());
super.render();
}
@Override
public void resize(int width , int height){
cam.update(width , height);
super.resize(width , height);
}
}