Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.badlogic.gdx.ApplicationAdapter;
- import com.badlogic.gdx.Gdx;
- import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
- import com.badlogic.gdx.graphics.GL20;
- import com.badlogic.gdx.graphics.g2d.BitmapFont;
- import com.badlogic.gdx.graphics.g2d.SpriteBatch;
- public class sscceScaledBitmapFont extends ApplicationAdapter {
- SpriteBatch batch;
- BitmapFont font;
- String text = "373";
- @Override
- public void create () {
- batch = new SpriteBatch();
- font = new BitmapFont(Gdx.files.internal("skin/uiDistance2015.fnt"));
- }
- @Override
- public void render () {
- Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
- font.setScale(1);
- batch.begin();
- font.draw(batch, text, 100, 300);
- batch.end();
- font.setScale(0.3f);
- batch.begin();
- font.draw(batch, text, 400, 300);
- batch.end();
- }
- public static void main (String[] args) throws Exception {
- new LwjglApplication(new sscceScaledBitmapFont());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement