I am creating a Label using a truetype font and the gdx-freetype-platform plugin/library.
FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/helveticablackoblique/Helvetica-Black Oblique.ttf"));
FreeTypeFontGenerator.FreeTypeFontParameter shadowParameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
shadowParameter.size = 100;
shadowParameter.borderColor = Color.BLACK;
shadowParameter.borderWidth = 3;
shadowParameter.shadowColor = Color.GRAY;
shadowParameter.shadowOffsetX = 3;
shadowParameter.shadowOffsetY = 3;
BitmapFont bitmapFontShadow = generator.generateFont(shadowParameter);
generator.dispose();
final Label.LabelStyle shadowStyle = new Label.LabelStyle(bitmapFontShadow, Color.WHITE);
final Label startNewGameLabel = new Label("NEW GAME", shadowStyle);
startNewGameLabel.debug();
startNewGameLabel.setPosition((Gdx.graphics.getWidth() / 2) - (startNewGameLabel.getWidth() / 2), (Gdx.graphics.getHeight() / 4 * 3) - (startNewGameLabel.getHeight() / 2));
stage.addActor(startNewGameLabel);
I've ommitted the other Labels on the screenshot, but they're all created in the same way, though the larger one uses parameter.size = 200
As you can see from the green box created by debug, the width seems to match (it may be slightly off because of the shadow/border but I can handle that) but the height is roughly half of the font. It means when I add a listener to it, the touch doesn't marry up to the actual font on screen.
Any idea what I'm doing wrong?