Skip to content
Snippets Groups Projects
Commit 7365837b authored by Rebekka Aashaug Stangvik's avatar Rebekka Aashaug Stangvik
Browse files

added go back button to join game view

parent 825f415f
No related branches found
No related tags found
1 merge request!19Resolve "Add settings button"
assets/bg_btn_settings.png

61.1 KiB

......@@ -64,6 +64,9 @@ public class JoinGameController {
System.out.println("Settings Pressed");
state.getStateManager().setState(new SettingsState(state.getStateManager(), _FBIC));
}
if (joinGameView.getGoBackButtonBounds().contains(touchPos.x, touchPos.y)) {
state.getStateManager().setState(new MainMenuState(state.getStateManager(), _FBIC ));
}
}
};
......
......@@ -43,20 +43,24 @@ public class JoinGameView {
private String errorMessage = "";
private Rectangle settingsBounds;
private Rectangle goBackButtonBounds;
public JoinGameView(OrthographicCamera cam){
this.cam = cam;
stage = new Stage(new ScreenViewport(cam));
Gdx.input.setInputProcessor(stage);
backgroundTexture = new Texture("bgWithSettings.png");
backgroundTexture = new Texture("bg_btn_settings.png");
nicknameTexture = new Texture("pink_long-01.png");
pinTexture = new Texture("pink_long-01.png");
joinGameButton = new Texture("join_game.png");
goBackButtonBounds = new Rectangle(
0,
WordBattle.HEIGHT - 100,
100,
100
);
joinGameButtonBounds = new Rectangle(
(WordBattle.WIDTH - joinGameButton.getWidth()) / 2,
......@@ -127,6 +131,11 @@ public class JoinGameView {
}
public Rectangle getGoBackButtonBounds() {
return goBackButtonBounds;
}
public Rectangle getSettingsBounds() { return settingsBounds; }
public void render(SpriteBatch spriteBatch){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment