|
|
|
|
@ -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();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|