Created
March 1, 2015 23:46
-
-
Save dzt/56827d142241ade62596 to your computer and use it in GitHub Desktop.
GDX Text Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.petersoboyejo.gdxgame; | |
public class Game extends ApplicationAdapter { | |
private SpriteBatch batch; | |
private BitmapFont font; | |
@Override | |
public void create() { | |
batch = new SpriteBatch(); | |
font = new BitmapFont(); | |
font.setColor(Color.BLUE); | |
font.scale(6); | |
} | |
@Override | |
public void dispose() { | |
batch.dispose(); | |
font.dispose(); | |
} | |
@Override | |
public void render() { | |
Gdx.gl.glClearColor(1, 1, 1, 1); | |
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); | |
batch.begin(); | |
font.draw(batch, "Some Stupid Text Belongs Here"), 200, 400; | |
batch.end(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment