Added font renderer.

This commit is contained in:
Jeasonfire 2015-05-11 14:01:54 +03:00
parent a06d8beffc
commit 3261557dc9
2 changed files with 5 additions and 0 deletions

1
.gitignore vendored
View File

@ -54,6 +54,7 @@ nbdist/
nbactions.xml nbactions.xml
nb-configuration.xml nb-configuration.xml
.nb-gradle/ .nb-gradle/
.nb-gradle-properties
## Gradle ## Gradle

View File

@ -10,6 +10,7 @@ import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
@ -26,6 +27,7 @@ public class RenderingSystem extends EntitySystem {
private ImmutableArray<Entity> entities; private ImmutableArray<Entity> entities;
private SpriteBatch batch; private SpriteBatch batch;
private BitmapFont font;
private ShapeRenderer debugRenderer; private ShapeRenderer debugRenderer;
private OrthographicCamera camera; private OrthographicCamera camera;
@ -38,6 +40,8 @@ public class RenderingSystem extends EntitySystem {
updateEntities(engine); updateEntities(engine);
batch = new SpriteBatch(); batch = new SpriteBatch();
font = new BitmapFont();
font.setScale(0.3f);
debugRenderer = new ShapeRenderer(); debugRenderer = new ShapeRenderer();
camera = new OrthographicCamera(); camera = new OrthographicCamera();
camera.setToOrtho(false, 1, 1); camera.setToOrtho(false, 1, 1);