Example usage for com.badlogic.gdx.graphics.g2d GlyphLayout GlyphLayout

List of usage examples for com.badlogic.gdx.graphics.g2d GlyphLayout GlyphLayout

Introduction

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

Prototype

public GlyphLayout(BitmapFont font, CharSequence str, Color color, float targetWidth, int halign,
        boolean wrap) 

Source Link

Usage

From source file:com.bss.game.World.java

License:Apache License

public World(WorldListener listener) {
    this.slappy = new SlappySeal(-10f, 95f);
    ///*from  w w w .  j  ava  2  s  .  co m*/
    this.hook = new Hook(80f, 250f, this);
    //this.boot = new Boot(480f, 400f, this, 0);
    //this.trout = new Trout(200f, 800f, this, 0);
    pointPosition = new Vector2();
    //this.hook.velocity.setAngle(90f);
    //
    /*this.platforms = new ArrayList<Platform>();
    this.springs = new ArrayList<Spring>();
    this.squirrels = new ArrayList<Squirrel>();
    this.coins = new ArrayList<Coin>();*/
    this.listener = listener;
    rand = new Random();
    //generateLevel();

    //this.heightSoFar = 0;
    //this.score = 0;

    time = 10;
    timeText = "" + time;
    layout = new GlyphLayout(Assets.font, timeText, Color.YELLOW, 0f, 0, false);
    //layout.setText(font, timeText, Color.BLACK, 0f, 0, false);

    this.state = WORLD_STATE_RUNNING;
    i = new Intersector();
    eh = new EllipseHit(10);

    enemies = new ArrayList<EnemyGameObject>();
    hookedEnemies = new ArrayList<EnemyGameObject>();
    setEnemiesFirst();
    hookedFish = 0;
}

From source file:exodus.FinalScreen.java

@Override
public void resize(int width, int height) {
    WIDTH = width;/*from   w ww .  ja  v  a  2 s .  com*/
    HEIGHT = height;

    float camWidth = 10.0f;
    float camHeight = camWidth * (float) HEIGHT / (float) WIDTH;
    cam2d = new OrthographicCamera(camWidth, camHeight);
    cam2d.position.set(camWidth / 2.0f, camHeight / 2.0f, 0.0f);
    cam2d.update();

    cam3d = new PerspectiveCamera(90.0f, camWidth, camHeight);
    cam3d.translate(0.0f, -10.0f, 3.0f);
    cam3d.lookAt(0.0f, 0.0f, 0.0f);
    cam3d.update(true);

    layout = new GlyphLayout(bitmapFont, String.format(FINAL_TEXT, saveGame.moves), Color.YELLOW,
            cam3d.viewportWidth, Align.center, true);

    Exodus.music.stop();
    Exodus.music = Sounds.play(Sound.ALIVE, Exodus.musicVolume);
}