From: malak585 Date: Fri, 8 Dec 2023 09:49:55 +0000 (+0100) Subject: fixed mouse positions X-Git-Url: https://gitweb.forssennils.se/?a=commitdiff_plain;h=772af1979cbcb8693862a790c10524609de03fc5;p=TDDC76_proj.git fixed mouse positions --- diff --git a/src/GameOver_menu.cc b/src/GameOver_menu.cc index b54de21..7bf2938 100644 --- a/src/GameOver_menu.cc +++ b/src/GameOver_menu.cc @@ -141,8 +141,8 @@ void GameOver_menu::update(Context& context) } // mouse placement - mouse_r.setPosition(((S_WIDTH / 2) + 60 - 30*(menu_index - 1)), ((S_HEIGHT / 2) + 85 + 50*(menu_index - 1))); - mouse_l.setPosition(((S_WIDTH / 2) - 58 + 30*(menu_index - 1)), ((S_HEIGHT / 2) + 85 + 50*(menu_index - 1))); + mouse_r.setPosition(((S_WIDTH / 2) + 60 - 30*(menu_index - 1)), ((S_HEIGHT / 2) + 80 + 50*(menu_index - 1))); + mouse_l.setPosition(((S_WIDTH / 2) - 58 + 30*(menu_index - 1)), ((S_HEIGHT / 2) + 80 + 50*(menu_index - 1))); } diff --git a/src/Pause_menu.cc b/src/Pause_menu.cc index cacd995..a8e8de5 100644 --- a/src/Pause_menu.cc +++ b/src/Pause_menu.cc @@ -89,8 +89,8 @@ void Pause_menu::update(Context& context) } // mouse placement - mouse_r.setPosition(((S_WIDTH / 2) + 60 - 7*(menu_index - 2)*(menu_index - 3) - 15*(menu_index - 1)*(menu_index - 2)), ((S_HEIGHT / 2) - 45 + 50*(menu_index - 1))); - mouse_l.setPosition(((S_WIDTH / 2) - 58 + 7*(menu_index - 2)*(menu_index - 3) + 15*(menu_index - 1)*(menu_index - 2)), ((S_HEIGHT / 2) - 45 + 50*(menu_index - 1))); + mouse_r.setPosition(((S_WIDTH / 2) + 60 - 7*(menu_index - 2)*(menu_index - 3) - 15*(menu_index - 1)*(menu_index - 2)), ((S_HEIGHT / 2) - 50 + 50*(menu_index - 1))); + mouse_l.setPosition(((S_WIDTH / 2) - 58 + 7*(menu_index - 2)*(menu_index - 3) + 15*(menu_index - 1)*(menu_index - 2)), ((S_HEIGHT / 2) - 50 + 50*(menu_index - 1))); } void Pause_menu::render(sf::RenderWindow& window) const diff --git a/src/Scoreboard_menu.cc b/src/Scoreboard_menu.cc index daa70dd..f2b6b47 100644 --- a/src/Scoreboard_menu.cc +++ b/src/Scoreboard_menu.cc @@ -89,18 +89,18 @@ void Scoreboard_menu::update(Context& context) // changes color on text depending on selection if( menu_index == 1) { - startmenutext.setFillColor(sf::Color(153, 0, 0)); - quittext.setFillColor(sf::Color::Black); + startmenutext.setFillColor(sf::Color::Black); + quittext.setFillColor(sf::Color(153, 0, 0)); } else if( menu_index == 2) { - startmenutext.setFillColor(sf::Color::Black); - quittext.setFillColor(sf::Color(153, 0, 0)); + startmenutext.setFillColor(sf::Color(153, 0, 0)); + quittext.setFillColor(sf::Color::Black); } // mouse placement - mouse_r.setPosition(((S_WIDTH / 2) + 45 - 30*(menu_index - 1)), ((S_HEIGHT / 2) + 65 + 50*(menu_index - 1))); - mouse_l.setPosition(((S_WIDTH / 2) - 73 + 30*(menu_index - 1)), ((S_HEIGHT / 2) + 65 + 50*(menu_index - 1))); + mouse_r.setPosition(((S_WIDTH / 2) + 45 - 30*(menu_index - 1)), ((S_HEIGHT / 2) + 60 + 50*(menu_index - 1))); + mouse_l.setPosition(((S_WIDTH / 2) - 73 + 30*(menu_index - 1)), ((S_HEIGHT / 2) + 60 + 50*(menu_index - 1))); } diff --git a/src/Start_menu.cc b/src/Start_menu.cc index e5c4b85..5472f94 100644 --- a/src/Start_menu.cc +++ b/src/Start_menu.cc @@ -90,8 +90,8 @@ void Start_menu::update(Context& context) } // mouse placement - mouse_r.setPosition(((S_WIDTH / 2) + 60 - 17*(menu_index - 1)*(menu_index - 2)), ((S_HEIGHT / 2) - 117 + 50*(menu_index - 1))); - mouse_l.setPosition(((S_WIDTH / 2) - 58 + 17*(menu_index - 1)*(menu_index - 2)), ((S_HEIGHT / 2) - 117 + 50*(menu_index - 1))); + mouse_r.setPosition(((S_WIDTH / 2) + 60 - 17*(menu_index - 1)*(menu_index - 2)), ((S_HEIGHT / 2) - 120 + 50*(menu_index - 1))); + mouse_l.setPosition(((S_WIDTH / 2) - 58 + 17*(menu_index - 1)*(menu_index - 2)), ((S_HEIGHT / 2) - 120 + 50*(menu_index - 1))); }