F.E.I.S/Widgets/BlankScreen.cpp
Stepland a3758f2846 fixed https://github.com/Stepland/F.E.I.S./issues/3
refactored Widgets into a folder to avoid huge files and circular dependency problems
2019-04-06 22:35:17 +02:00

27 lines
849 B
C++

//
// Created by symeon on 06/04/19.
//
#include "BlankScreen.h"
BlankScreen::BlankScreen() : gris_de_fond(sf::Color(38, 38, 38)) {
if(!tex_FEIS_logo.loadFromFile("assets/textures/FEIS_logo.png"))
{
throw std::__cxx11::string("Unable to load assets/textures/FEIS_logo.png");
}
tex_FEIS_logo.setSmooth(true);
FEIS_logo.setTexture(tex_FEIS_logo);
FEIS_logo.setColor(sf::Color(255, 255, 255, 32)); // un huitième opaque
}
void BlankScreen::render(sf::RenderWindow& window) {
// effacement de la fenêtre en noir
window.clear(gris_de_fond);
// c'est ici qu'on dessine tout
FEIS_logo.setPosition(sf::Vector2f(static_cast<float>((window.getSize().x - tex_FEIS_logo.getSize().x) / 2),
static_cast<float>((window.getSize().y-tex_FEIS_logo.getSize().y)/2)));
window.draw(FEIS_logo);
}