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

#66 Smooth text for score counter in Shooting range game and Robbery game

parent db85fd85
Branches feature-runesgame-translations
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@ import java.util.Random;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
import cz.nic.tablexia.game.games.robbery.assets.RobberyAssets;
import cz.nic.tablexia.game.games.robbery.creature.CreatureRoot;
import cz.nic.tablexia.loader.application.ApplicationFontManager;
import cz.nic.tablexia.util.ui.TablexiaNoBlendingImage;
import static com.badlogic.gdx.scenes.scene2d.actions.Actions.alpha;
......@@ -226,9 +227,10 @@ public class GameScreen extends AbstractRobberyScreen {
private static final float COLORBANNER_X_POSITION_RATIO = 1f/2;
private static final float COLORBANNER_WIDTH_RATIO = 1f/3;
private static final float PERSON_COUNTER_POSITION_X_RATIO = 5f/6;
private static final float PERSON_COUNTER_POSITION_Y_RATIO = 1f/4;
private static final Color PERSON_COUNTER_TEXT_COLOR = Color.WHITE;
private static final float PERSON_COUNTER_POSITION_X_RATIO = 5f/6;
private static final float PERSON_COUNTER_POSITION_Y_RATIO = 1f/4;
private static final Color PERSON_COUNTER_TEXT_COLOR = Color.WHITE;
private static final ApplicationFontManager.FontType PERSON_COUNTER_FONT = ApplicationFontManager.FontType.ROBOTO_BOLD_20;
private static final Interpolation INFOITEM_HIDE_INTERPOLATION = Interpolation.pow4In;
private static final Interpolation INFOITEM_SHOW_ALPHA_INTERPOLATION = Interpolation.pow4Out;
......@@ -316,7 +318,7 @@ public class GameScreen extends AbstractRobberyScreen {
getSceneWidth() + BACKGROUND_BOTTOM_WIDTH_CORRECTION_OFFSET,
getSceneOuterHeight());
personCounter = new Label("", new Label.LabelStyle(getDefaultBoldFont(), PERSON_COUNTER_TEXT_COLOR));
personCounter = new Label("", new Label.LabelStyle(getFont(PERSON_COUNTER_FONT), PERSON_COUNTER_TEXT_COLOR));
personCounter.setPosition(width * PERSON_COUNTER_POSITION_X_RATIO, height * PERSON_COUNTER_POSITION_Y_RATIO);
getStage().addActor(doorBackground);
......
......@@ -31,6 +31,7 @@ import cz.nic.tablexia.game.games.shooting_range.tools.HitEvaluator;
import cz.nic.tablexia.game.games.shooting_range.tools.PixelPerfectHitEvaluator;
import cz.nic.tablexia.game.games.shooting_range.tools.TargetGenerator;
import cz.nic.tablexia.game.games.shooting_range.tools.TargetPositionController;
import cz.nic.tablexia.loader.application.ApplicationFontManager;
import cz.nic.tablexia.model.game.Game;
/**
......@@ -38,6 +39,9 @@ import cz.nic.tablexia.model.game.Game;
*/
public class ShootingRangeGame extends AbstractTablexiaGame<GameState> {
private static final ApplicationFontManager.FontType SCORE_COUNTER_TEXT_FONT = ApplicationFontManager.FontType.ROBOTO_BOLD_20;
private static final Color SCORE_COUNTER_TEXT_COLOR = Color.WHITE;
private GfxLibrary gfxLibrary = new GfxLibrary(this, TextureType.values());
private SfxLibrary sfxLibrary = new SfxLibrary(this, SoundType.values());
......@@ -254,7 +258,7 @@ public class ShootingRangeGame extends AbstractTablexiaGame<GameState> {
watch.setScale(0.4f);
getStage().addActor(carousel = new Carousel(gfxLibrary));
carousel.setScale(0.6f);
Label.LabelStyle labelStyle = new Label.LabelStyle(getDefaultBoldFont(), Color.WHITE);
Label.LabelStyle labelStyle = new Label.LabelStyle(getFont(SCORE_COUNTER_TEXT_FONT), SCORE_COUNTER_TEXT_COLOR);
getStage().addActor(score = new Label("0", labelStyle));
screenResized((int) getStage().getWidth(), (int) getStage().getHeight());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment