Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mygdx.makescents;
- import com.badlogic.gdx.graphics.g2d.BitmapFont;
- import com.badlogic.gdx.graphics.g2d.SpriteBatch;
- import com.badlogic.gdx.utils.Align;
- public class GameTitle {
- private BitmapFont font;
- private String title;
- private float x;
- private float y;
- private float width;
- private float height;
- private SpriteBatch batch;
- public GameTitle(String title, float x, float y, float width, float height) {
- this.font = new BitmapFont();
- this.title = "Makes Cents";
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
- }
- public void draw(SpriteBatch batch) {
- font.getData().setScale(2);
- font.draw(batch, title, x, y, width, Align.center, true);
- }
- public void dispose() {
- font.dispose();
- if (batch != null) {
- batch.dispose();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement