Skip to content
Snippets Groups Projects
Commit db85fd85 authored by Matyáš Latner's avatar Matyáš Latner
Browse files

#66 Smooth text in Kidnapping game and replay button size fix

parent 419443ec
Branches
Tags
No related merge requests found
......@@ -2,26 +2,28 @@ package cz.nic.tablexia.game.games.kidnapping.actors;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import cz.nic.tablexia.loader.application.ApplicationFontManager;
/**
* Created by lhoracek on 5/19/15.
*/
public class EarOverlay extends Group {
private static final ApplicationFontManager.FontType FONT_TYPE = ApplicationFontManager.FontType.ROBOTO_REGULAR_30;
private static final Color FONT_COLOR = Color.WHITE;
private Image ear, overlay;
private Label text;
public EarOverlay(String text, Texture overlayTexture, TextureRegion earTexture) {
this.addActor(overlay = new Image(overlayTexture));
this.addActor(ear = new Image(earTexture));
BitmapFont bf = new BitmapFont(); // TODO change font
bf.getData().setScale(3);
this.addActor(this.text = new Label(text, new Label.LabelStyle(bf, Color.WHITE)));
this.addActor(this.text = new Label(text, new Label.LabelStyle(ApplicationFontManager.getInstance().getFont(FONT_TYPE), FONT_COLOR)));
}
@Override
......@@ -32,10 +34,6 @@ public class EarOverlay extends Group {
text.setPosition(getWidth() / 2 - text.getWidth() / 2, getHeight() / 5 - text.getHeight() / 2);
}
public Image getEar() {
return ear;
}
public Label getText() {
return text;
}
......
......@@ -9,10 +9,13 @@ import cz.nic.tablexia.util.ui.TablexiaButton;
*/
public class ReplayButton extends TablexiaButton {
private static final String REPLAY_BUTTON_TEXT_KEY = "game_kidnapping_replay";
private static final int WIDTH = 200;
private static final int HEIGHT = 80;
public ReplayButton(KidnappingGame screen) {
// TODO fix getting text through screen
super(screen.getText("game_kidnapping_replay"), ButtonType.GREEN);
setSize(150, 80);
super(screen.getText(REPLAY_BUTTON_TEXT_KEY), ButtonType.GREEN);
setSize(WIDTH, HEIGHT);
setDisabled(true);
}
}
......
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