master
GammelJAN 5 years ago
parent 6a8b99a575
commit 0ca67870d6

@ -2,18 +2,20 @@ package com.trs.game;
import com.badlogic.gdx.ApplicationAdapter; import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
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.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
public class Controller extends ApplicationAdapter { public class Controller extends ApplicationAdapter {
SpriteBatch batch; SpriteBatch batch;
Texture img; ShapeRenderer renderer;
@Override @Override
public void create () { public void create () {
batch = new SpriteBatch(); batch = new SpriteBatch();
img = new Texture("badlogic.jpg"); renderer = new ShapeRenderer();
} }
@Override @Override
@ -21,13 +23,18 @@ public class Controller extends ApplicationAdapter {
Gdx.gl.glClearColor(1, 0, 0, 1); Gdx.gl.glClearColor(1, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin(); batch.begin();
batch.draw(img, 0, 0);
batch.end(); batch.end();
renderer.begin(ShapeRenderer.ShapeType.Filled);
renderer.setColor(Color.WHITE);
renderer.rect(50,50,0,0,50,50,1,1,45);
renderer.setColor(Color.BLACK);
renderer.circle(50,50,5);
renderer.end();
} }
@Override @Override
public void dispose () { public void dispose () {
batch.dispose(); batch.dispose();
img.dispose(); renderer.dispose();
} }
} }

@ -1,4 +1,13 @@
package com.trs.game.view; package com.trs.game.view;
import com.badlogic.gdx.math.Polygon;
import com.badlogic.gdx.math.Rectangle;
public class View { public class View {
Rectangle r;
Polygon p;
View(){
}
} }

Loading…
Cancel
Save