Voilà
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "Test lib");
window.setFramerateLimit(60);
// GUI
gui::EngineManager *engine = gui::EngineManager::GetInstance();
engine->AddScene(window);
gui::Window *fenetre = new gui::Window("JE SUIS UNE FENETRE", 200, 50, 300, 500);
sf::RectangleShape rect1(sf::Vector2f(108, 38));
rect1.setPosition(sf::Vector2f(220, 75));
sf::RectangleShape rect2(sf::Vector2f(108, 38));
rect2.setPosition(sf::Vector2f(338, 75));
sf::RectangleShape rect3(sf::Vector2f(108, 38));
rect3.setPosition(sf::Vector2f(220, 120));
sf::Font font; font.loadFromFile("Fonts/BorisBlackBloxx.ttf");
sf::Text text1("Bouton 1", font, 15);
text1.setColor(sf::Color::Black);
text1.setPosition(rect1.getPosition().x + 20, rect1.getPosition().y + 7);
sf::Text text2("Bouton 2", font, 15);
text2.setColor(sf::Color::Black);
text2.setPosition(rect2.getPosition().x + 20, rect2.getPosition().y + 7);
sf::Text text3("Bouton 3", font, 15);
text3.setColor(sf::Color::Black);
text3.setPosition(rect3.getPosition().x + 20, rect3.getPosition().y + 7);
// Scrolling
sf::View view(sf::FloatRect(210, 73, 280, 469));
view.setViewport(sf::FloatRect((float)210/800, (float)73/600, (float)280/800, (float)469/600));
while(window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if(event.type == sf::Event::Closed)
window.close();
engine->HandleEvent(event);
fenetre->Update();
}
window.clear(sf::Color::Black);
window.setView(window.getDefaultView());
fenetre->Draw();
window.setView(view);
window.draw(rect1);
window.draw(rect2);
window.draw(rect3);
window.draw(text1);
window.draw(text2);
window.draw(text3);
window.display();
}
engine->kill();
return 0;
}