#pragma once #include #include class Ecran { static const uint bottomTxtPadding = 30; std::string message; public: // Fenêtre static sf::RenderWindow window; Ecran(const uint width = 800, const uint height = 800, const std::string name = "Projet"); // constructor ~Ecran(); // destructor void afficher( /* Fonction appellée à chaque image */ const std::function drawEachFrame = {[]() {}}, /* Prend 2 arguments: position X, position Y * -> appellé à chaque fois que l'utilisateur fait clic gauche */ const std::function doOnLeftClick = { [](const int, const int) {}}) const; // Largeur fenêtre static uint largeur() { return window.getSize().x; } // Hauteur fenêtre static uint hauteur() { return window.getSize().y - bottomTxtPadding; } // Ecrire un message en bas de l'écran void printMessage(std::string msg); // Efface le message en bas de l'écran void cleanMessage(); };