Basic setup

This commit is contained in:
BlueNutterfly 2018-11-10 21:32:04 +04:00
parent 8f00390eed
commit dd6aa7da5f
2 changed files with 21 additions and 12 deletions

View File

@ -2,32 +2,38 @@ package com.me.brickbuster;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
public class BrickBuster extends ApplicationAdapter {
SpriteBatch batch;
Texture img;
public static final int WIDTH = 800;
public static final int HEIGHT = 600;
public static final String TITLE = "Brick Buster";
ShapeRenderer shapeRenderer;
@Override
public void create () {
batch = new SpriteBatch();
img = new Texture("badlogic.jpg");
this.shapeRenderer = new ShapeRenderer();
}
@Override
public void render () {
Gdx.gl.glClearColor(1, 0, 0, 1);
Gdx.gl.glClearColor(0.5f,1,1,1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
batch.draw(img, 0, 0);
batch.end();
this.shapeRenderer.begin(ShapeType.Filled);
this.shapeRenderer.setColor(Color.CHARTREUSE);
this.shapeRenderer.circle(0,0, 100, 50);
this.shapeRenderer.end();
}
@Override
public void dispose () {
batch.dispose();
img.dispose();
}
}

View File

@ -7,6 +7,9 @@ import com.me.brickbuster.BrickBuster;
public class DesktopLauncher {
public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.width = BrickBuster.WIDTH;
config.height = BrickBuster.HEIGHT;
config.title = BrickBuster.TITLE;
new LwjglApplication(new BrickBuster(), config);
}
}