Commit 3d505edb authored by Fjen Undso's avatar Fjen Undso
Browse files

mainmenu: fix gametitle placement. ref #15

parent 85590716
......@@ -66,6 +66,11 @@ public class FrozenNumbersGame extends ApplicationAdapter {
size3Params.fontParameters.size = 40;
assets.load("size40.ttf", BitmapFont.class, size3Params);
FreetypeFontLoader.FreeTypeFontLoaderParameter size4Params = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
size4Params.fontFileName = "fonts/crayon.ttf";
size4Params.fontParameters.size = 60;
assets.load("size60.ttf", BitmapFont.class, size4Params);
assets.load("backgrounds/background.jpg", Texture.class);
// menu
assets.load("sprites/btn_help.png", Texture.class);
......
......@@ -8,6 +8,7 @@ import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.GlyphLayout;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
......@@ -25,6 +26,7 @@ public class MainMenuScreen implements Screen {
Sprite p1_quest, p2_quest;
boolean p1_isready, p2_isready;
float wWidth, wHeight;
GlyphLayout glyphLayout = new GlyphLayout();
public MainMenuScreen(Game g, Map<String, Screen> m) {
game = g;
......@@ -102,7 +104,7 @@ public class MainMenuScreen implements Screen {
}
//drawing stuff
// Drawing Stuff
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
Batch batch = FrozenNumbersGame.batch;
......@@ -116,13 +118,15 @@ public class MainMenuScreen implements Screen {
p1_quest.draw(batch);
p2_quest.draw(batch);
Label p2TextLabel = new Label("Frozen Numbers", new Label.LabelStyle(FrozenNumbersGame.assets.get("size40.ttf", BitmapFont.class), Color.WHITE));
// Game Title
Table container = new Table();
container.setTransform(true);
container.add(p2TextLabel);
Label p2GameTName = new Label("Frozen Numbers", new Label.LabelStyle(FrozenNumbersGame.assets.get("size60.ttf", BitmapFont.class), Color.WHITE));
container.add(p2GameTName);
container.setPosition(wWidth / 2.0f, wHeight / 2.0f - 30);
container.draw(batch, 1);
container.setRotation(180);
container.setPosition((float) (wWidth / 2.0), (float) (wHeight / 2.0 + 60));
container.setPosition(wWidth / 2.0f, wHeight / 2.0f + 30);
container.draw(batch, 1);
batch.end();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment