From: Alma Dejus Date: Wed, 15 Nov 2023 12:41:36 +0000 (+0100) Subject: changed font in start menu - Alma och Malin X-Git-Url: https://gitweb.forssennils.se/?a=commitdiff_plain;h=be2259f5c989dc866bea53bc1fbac8fd37b00d91;p=TDDC76_proj.git changed font in start menu - Alma och Malin --- diff --git a/assets/fonts/OFL.txt b/assets/fonts/OFL.txt index 077aecc..a1122d6 100644 --- a/assets/fonts/OFL.txt +++ b/assets/fonts/OFL.txt @@ -1,4 +1,4 @@ -Copyright 2014 The Comic Neue Project Authors (https://github.com/crozynski/comicneue) +Copyright 2011 The Philosopher Project Authors (lemonad@jovanny.ru) This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, and is also available with a FAQ at: diff --git a/assets/fonts/Philosopher-Regular.ttf b/assets/fonts/Philosopher-Regular.ttf new file mode 100644 index 0000000..3f325bf Binary files /dev/null and b/assets/fonts/Philosopher-Regular.ttf differ diff --git a/src/States.cc b/src/States.cc index 8a59ded..2da252f 100644 --- a/src/States.cc +++ b/src/States.cc @@ -75,7 +75,7 @@ Start_menu::Start_menu() : texture{}, texture2{}, sprite{}, mouse_l{}, mouse_r{ //load textfont - if ( !font.loadFromFile ("assets/fonts/ComicNeue-Bold.ttf") ) + if ( !font.loadFromFile ("assets/fonts/Philosopher-Regular.ttf") ) throw std::invalid_argument ("Unable to load font"); //start @@ -83,22 +83,18 @@ Start_menu::Start_menu() : texture{}, texture2{}, sprite{}, mouse_l{}, mouse_r{ sf::FloatRect gbts {starttext.getGlobalBounds()}; starttext.setOrigin(gbts.width / 2, gbts.height / 2); starttext.setPosition ((S_WIDTH) / 2, ((S_HEIGHT / 2) - 100)); - starttext.setFillColor(sf::Color::Black); //score scoreboardtext = sf::Text{ "Scoreboard", font, 24 }; sf::FloatRect gbtb {scoreboardtext.getGlobalBounds()}; scoreboardtext.setOrigin(gbtb.width / 2, gbtb.height / 2); scoreboardtext.setPosition (S_WIDTH / 2, ((S_HEIGHT / 2) - 50)); - scoreboardtext.setFillColor(sf::Color::Black); //quit quittext = sf::Text{ "Quit", font, 24 }; sf::FloatRect gbtq {quittext.getGlobalBounds()}; quittext.setOrigin(gbtq.width / 2, gbtq.height / 2); quittext.setPosition (S_WIDTH / 2, S_HEIGHT / 2); - quittext.setFillColor(sf::Color::Black); - } void Start_menu::update(Context& context) @@ -126,8 +122,8 @@ void Start_menu::update(Context& context) scoreboardtext.setFillColor(sf::Color::Black); quittext.setFillColor(sf::Color::Yellow); } - - + + // mouse placement mouse_r.setPosition(((S_WIDTH / 2) + 60), ((S_HEIGHT / 2) - 115 + 50*(menu_index - 1))); mouse_l.setPosition(((S_WIDTH / 2) - 58), ((S_HEIGHT / 2) - 68 + 50*(menu_index - 1))); @@ -166,21 +162,18 @@ void Start_menu::handle_input(sf::Event& event) else if(menu_index == 2) { - std::cout << "det funka att se poäng" << std::endl; // lägg in state för scoreboard sen menu_index = 1; } else if(menu_index == 3) { exit_game = true; - std::cout << "det funka att stänga av" << std::endl; menu_index = 1; } break; case sf::Keyboard::Up: - std::cout << "det funka att trycka på upp" << std::endl; if(menu_index == 1) { break; @@ -193,7 +186,6 @@ void Start_menu::handle_input(sf::Event& event) break; case sf::Keyboard::Down: - std::cout << "det funka att trycka på ned" << std::endl; if(menu_index == 3) { break;