Example usage for com.badlogic.gdx.graphics.g2d BitmapFont drawWrapped

List of usage examples for com.badlogic.gdx.graphics.g2d BitmapFont drawWrapped

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g2d BitmapFont drawWrapped.

Prototype

public TextBounds drawWrapped(Batch batch, CharSequence str, float x, float y, float wrapWidth,
        HAlignment alignment) 

Source Link

Document

Draws a string, which may contain newlines (\n), with the specified position.

Usage

From source file:com.todoroo.zxzx.WorldView.java

License:Apache License

private void drawText(CharSequence string) {
    BitmapFont font = Assets.textFont;
    spriteBatch.begin();//w  w  w  .  j  a  va 2 s.  com
    spriteBatch.setColor(Color.WHITE);
    font.drawWrapped(spriteBatch, string, worldCam.viewportWidth * 0.1f, worldCam.viewportHeight / 2,
            worldCam.viewportWidth * 0.8f, HAlignment.CENTER);
    spriteBatch.end();
}