diff --git a/core/src/com/dungeoncrawler/Grafik.java b/core/src/com/dungeoncrawler/Grafik.java new file mode 100644 index 0000000..08a0175 --- /dev/null +++ b/core/src/com/dungeoncrawler/Grafik.java @@ -0,0 +1,33 @@ +package com.dungeoncrawler; + +import com.badlogic.gdx.ApplicationAdapter; +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.GL20; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; + +public class Grafik extends ApplicationAdapter { + SpriteBatch batch; + Texture img; + + @Override + public void create () { + batch = new SpriteBatch(); + img = new Texture("badlogic.jpg"); + } + + @Override + public void render () { + Gdx.gl.glClearColor(1, 0, 0, 1); + Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); + batch.begin(); + batch.draw(img, 0, 0); + batch.end(); + } + + @Override + public void dispose () { + batch.dispose(); + img.dispose(); + } +} diff --git a/core/src/com/dungeoncrawler/Main.java b/core/src/com/dungeoncrawler/Main.java index 0b9e642..47e78e0 100644 --- a/core/src/com/dungeoncrawler/Main.java +++ b/core/src/com/dungeoncrawler/Main.java @@ -1,33 +1,7 @@ package com.dungeoncrawler; import com.badlogic.gdx.ApplicationAdapter; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.GL20; -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.graphics.g2d.SpriteBatch; public class Main extends ApplicationAdapter { - SpriteBatch batch; - Texture img; - @Override - public void create () { - batch = new SpriteBatch(); - img = new Texture("badlogic.jpg"); - } - - @Override - public void render () { - Gdx.gl.glClearColor(1, 0, 0, 1); - Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); - batch.begin(); - batch.draw(img, 0, 0); - batch.end(); - } - - @Override - public void dispose () { - batch.dispose(); - img.dispose(); - } }