-
Notifications
You must be signed in to change notification settings - Fork 1
/
endscreen.cpp
31 lines (27 loc) · 1.03 KB
/
endscreen.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "endscreen.hpp"
EndScreen::EndScreen(const sf::Font &font, sf::Sprite &background_sp, const sf::Color &fillColor, const sf::Color &outlineColor)
: Screen(fillColor, outlineColor, font),
background_sp(background_sp)
{ }
void EndScreen::processEvent(const sf::Event &event) {
switch (event.type) {
case sf::Event::KeyPressed:
switch (event.key.code) {
case sf::Keyboard::Return:
case sf::Keyboard::Space:
eventReceiver({Event::SHOW_CLEAN_MENU});
break;
default:
break;
}
break;
default:
break;
}
}
void EndScreen::draw(sf::RenderTarget &target, sf::RenderStates states) const {
target.draw(background_sp, states);
drawCenteredText(target, states, "CONGRATULATIONS", 90, 3, target.getSize().y / 2 - 160);
drawCenteredText(target, states, "YOU FINISHED ALL LEVELS", 60, 3, target.getSize().y / 2 - 60);
drawCenteredText(target, states, "PRESS ENTER/SPACEBAR TO GO BACK TO MENU", 50, 1, target.getSize().y - 150);
}