master
GammelJan 6 years ago
parent f9f680cc8e
commit 6c76e6edbb

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -10,7 +10,9 @@ import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input; import com.badlogic.gdx.Input;
import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.SpriteBatch;
/** /**
@ -19,8 +21,18 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch;
*/ */
public class Titlescreen extends AbstractScreen{ public class Titlescreen extends AbstractScreen{
BitmapFont font;
SpriteBatch batch;
Sprite clicktostart;
public Titlescreen(Game game){ public Titlescreen(Game game){
super(game); super(game);
batch = new SpriteBatch();
clicktostart = new Sprite(new Texture(Gdx.files.internal("clicktostart.png")));
clicktostart.setX(Gdx.graphics.getWidth() / 2 - clicktostart.getWidth() / 2);
clicktostart.setY(Gdx.graphics.getHeight() / 2 - clicktostart.getHeight() / 2);
} }
@Override @Override
@ -32,13 +44,7 @@ public class Titlescreen extends AbstractScreen{
Gdx.gl.glClearColor(1f, 1f, 1f, 1f); Gdx.gl.glClearColor(1f, 1f, 1f, 1f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
BitmapFont font = new BitmapFont();
font.setColor(Color.RED);
SpriteBatch batch = new SpriteBatch();
batch.begin(); batch.begin();
font.draw(batch, "TITLESCREEN", 250, 250);
batch.end(); batch.end();
if(Gdx.input.justTouched()){ if(Gdx.input.justTouched()){

@ -8,6 +8,9 @@ import controller.Controller;
public class DesktopLauncher { public class DesktopLauncher {
public static void main (String[] arg) { public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
//config.fullscreen = true;
config.height = 720;
config.width = 1280;
new LwjglApplication(new Main(), config); new LwjglApplication(new Main(), config);
} }
} }

Loading…
Cancel
Save