diff --git a/core/assets/Button.png b/core/assets/Button.png new file mode 100644 index 0000000..c6bdc93 Binary files /dev/null and b/core/assets/Button.png differ diff --git a/core/assets/Title.png b/core/assets/Title.png new file mode 100644 index 0000000..e2df3a4 Binary files /dev/null and b/core/assets/Title.png differ diff --git a/core/src/com/dungeoncrawler/Main.java b/core/src/com/dungeoncrawler/Main.java index 6b16bc0..5fc55d5 100644 --- a/core/src/com/dungeoncrawler/Main.java +++ b/core/src/com/dungeoncrawler/Main.java @@ -7,7 +7,7 @@ public class Main extends ApplicationAdapter { View v; - Main(){ + public Main(){ v = new View(); } diff --git a/core/src/com/dungeoncrawler/view/View.java b/core/src/com/dungeoncrawler/view/View.java index 4c75d76..01024e8 100644 --- a/core/src/com/dungeoncrawler/view/View.java +++ b/core/src/com/dungeoncrawler/view/View.java @@ -5,29 +5,42 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.graphics.g2d.Sprite; public class View extends ApplicationAdapter { SpriteBatch batch; - Texture img; - + Texture b; + Texture t; + Sprite button; + Sprite title; + @Override public void create () { batch = new SpriteBatch(); - img = new Texture("badlogic.jpg"); + b = new Texture("button.png"); + t = new Texture("title.png"); + button = new Sprite(b); + title = new Sprite(t); + title.setX(0); + title.setY(0); + button.setX(75); + button.setY(150); } @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); + title.draw(batch); + button.draw(batch); batch.end(); } @Override public void dispose () { batch.dispose(); - img.dispose(); + } }