Skip to content
Snippets Groups Projects
Commit 52f1ffb8 authored by Vitaliy Vashchenko's avatar Vitaliy Vashchenko
Browse files

#287 Corrected buttons layer to match background asset.

parent 2e63630a
No related branches found
No related tags found
No related merge requests found
......@@ -20,10 +20,9 @@ import cz.nic.tablexia.screen.gamemenu.event.ShowGameMenuPageEvent;
*/
public class WallOfGames extends Group {
private static final float RELAVITE_MAX_ICON_HEIGHT = 0.3f;
private static final float RELATIVE_HEIGHT = 0.9f;
private static final float BUTTONS_GROUP_RELATIVE_WIDTH = 0.65f;
private static final float BUTTONS_GROUP_RELATIVE_WIDTH = 0.58f;
private static final float BUTTONS_GROUP_RELATIVE_HEIGHT = 0.9f;
private static final float BUTTONS_GROUP_RELATIVE_X = 0.05f;
private static final float BUTTONS_GROUP_RELATIVE_Y = 0.05f;
......@@ -33,8 +32,6 @@ public class WallOfGames extends Group {
private HashMap<String, TextureRegion> wallOfGamesTextures;
private Group buttonsGroup,backgroundLayer, underneathLayer;
// TODO: 24.8.16 change mobile layout
private WallOfGames(HashMap<String, TextureRegion> wallOfGamesTextures, Stage stage, float width, float height) {
this.stageWidth = width;
this.stageHeight = height;
......@@ -61,20 +58,18 @@ public class WallOfGames extends Group {
background.addListener(wallClickListener);
backgroundLayer.addActor(background);
addActor(backgroundLayer);
}
private void prepareUnderneathLayer(){
// TODO: 30.8.16 size underneathLayer with screen size
underneathLayer = new Group();
underneathLayer.setSize(TablexiaSettings.getViewportWidth(stage),TablexiaSettings.getSceneOuterHeight(stage));
underneathLayer.setSize(TablexiaSettings.getViewportWidth(stage), TablexiaSettings.getSceneOuterHeight(stage));
underneathLayer.setPosition(TablexiaSettings.getSceneLeftX(stage), TablexiaSettings.getSceneOuterBottomY(stage));
underneathLayer.setDebug(TablexiaSettings.getInstance().isShowBoundingBoxes());
underneathLayer.addListener(wallClickListener);
stage.addActor(underneathLayer);
}
private void prepareButtonsLayer() {
buttonsGroup = new Group();
buttonsGroup.setDebug(TablexiaSettings.getInstance().isShowBoundingBoxes());
......@@ -89,7 +84,6 @@ public class WallOfGames extends Group {
public float getWidth() {
return backgroundLayer.getWidth();
}
@Override
public float getHeight() {
......@@ -131,19 +125,17 @@ public class WallOfGames extends Group {
underneathLayer.remove();
remove();
}
public enum GameIconDefinition {
ROBBERY(GameMenuAssets.WALL_OF_GAMES_ICON_ROBBERY, GameMenuAssets.WALL_OF_GAMES_ICON_ROBBERY_PRESSED, 0.1f, 0.65f,GameMenuScreen.GameMenuPageDefinition.ROBBERY_PAGE),
PURSUIT(GameMenuAssets.WALL_OF_GAMES_ICON_PURSUIT, GameMenuAssets.WALL_OF_GAMES_ICON_PURSUIT_PRESSED, 0.12f, 0.33f, GameMenuScreen.GameMenuPageDefinition.PURSUIT_PAGE),
KIDNAPPING(GameMenuAssets.WALL_OF_GAMES_ICON_KIDNAPPING, GameMenuAssets.WALL_OF_GAMES_ICON_KIDNAPPING_PRESSED, 0.11f, 0f, GameMenuScreen.GameMenuPageDefinition.KIDNAPPING_PAGE),
NIGHTWATCH(GameMenuAssets.WALL_OF_GAMES_ICON_NIGHTWATCH, GameMenuAssets.WALL_OF_GAMES_ICON_NIGHTWATCH_PRESSED, 0.34f, 0.67f, GameMenuScreen.GameMenuPageDefinition.NIGH_WATCH_PAGE),
SHOOTINGRANGE(GameMenuAssets.WALL_OF_GAMES_ICON_SHOOTINGRANGE, GameMenuAssets.WALL_OF_GAMES_ICON_SHOOTINGRANGE_PRESSED, 0.32f, 0.3f, GameMenuScreen.GameMenuPageDefinition.SHOOTING_RANGE_PAGE),
INTHEDARKNESS(GameMenuAssets.WALL_OF_GAMES_ICON_INTHEDARKNESS, GameMenuAssets.WALL_OF_GAMES_ICON_INTHEDARKNESS_PRESSED, 0.57f, 0.63f, GameMenuScreen.GameMenuPageDefinition.IN_THE_DARKNESS_PAGE),
CRIMESCENE(GameMenuAssets.WALL_OF_GAMES_ICON_CRIMESCENE, GameMenuAssets.WALL_OF_GAMES_ICON_CRIMESCENE_PRESSED, 0.6f, 0.3f, GameMenuScreen.GameMenuPageDefinition.CRIME_SCENE_PAGE),
RUNES(GameMenuAssets.WALL_OF_GAMES_ICON_RUNES, GameMenuAssets.WALL_OF_GAMES_ICON_RUNES_PRESSED, 0.5f, 0f, GameMenuScreen.GameMenuPageDefinition.RUNES_PAGE);
NIGHTWATCH(GameMenuAssets.WALL_OF_GAMES_ICON_NIGHTWATCH, GameMenuAssets.WALL_OF_GAMES_ICON_NIGHTWATCH_PRESSED, 0.38f, 0.67f, GameMenuScreen.GameMenuPageDefinition.NIGH_WATCH_PAGE),
SHOOTINGRANGE(GameMenuAssets.WALL_OF_GAMES_ICON_SHOOTINGRANGE, GameMenuAssets.WALL_OF_GAMES_ICON_SHOOTINGRANGE_PRESSED, 0.36f, 0.3f, GameMenuScreen.GameMenuPageDefinition.SHOOTING_RANGE_PAGE),
INTHEDARKNESS(GameMenuAssets.WALL_OF_GAMES_ICON_INTHEDARKNESS, GameMenuAssets.WALL_OF_GAMES_ICON_INTHEDARKNESS_PRESSED, 0.68f, 0.63f, GameMenuScreen.GameMenuPageDefinition.IN_THE_DARKNESS_PAGE),
CRIMESCENE(GameMenuAssets.WALL_OF_GAMES_ICON_CRIMESCENE, GameMenuAssets.WALL_OF_GAMES_ICON_CRIMESCENE_PRESSED, 0.7f, 0.3f, GameMenuScreen.GameMenuPageDefinition.CRIME_SCENE_PAGE),
RUNES(GameMenuAssets.WALL_OF_GAMES_ICON_RUNES, GameMenuAssets.WALL_OF_GAMES_ICON_RUNES_PRESSED, 0.55f, 0f, GameMenuScreen.GameMenuPageDefinition.RUNES_PAGE);
private String unpressed, pressed;
private float x, y;
......
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