Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <SFML/Graphics.hpp>
- #include <TGUI/TGUI.hpp>
- int main()
- {
- sf::RenderWindow window(sf::VideoMode(800, 450), "TGUI");
- window.setVerticalSyncEnabled(true);
- tgui::Gui gui(window);
- gui.setGlobalFont("visitor1.ttf");
- tgui::ChatBox::Ptr chatbox(gui);
- chatbox->load("data/tgui/widgets/White.conf");
- chatbox->setPosition({ 100.f, 100.f });
- chatbox->setSize(300.f, 300.f);
- chatbox->addLine("Test", sf::Color::Black);
- chatbox->addLine("Test2", sf::Color::Black);
- chatbox->addLine("ASFASF", sf::Color::Black);
- gui.saveWidgetsToFile("test.txt");
- while (window.isOpen())
- {
- sf::Event event;
- while (window.pollEvent(event))
- {
- if (event.type == sf::Event::Closed)
- window.close();
- gui.handleEvent(event);
- }
- tgui::Callback callback;
- while (gui.pollCallback(callback))
- {
- }
- window.clear();
- gui.draw();
- window.display();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement