No widgets are drawn when call gui.draw(), but usual SFML stuff draws correctly. Debug tells nothing. Im trying to draw button and a sfml circle, and get only circle.
Code (cpp) Select
#include<TGUI/TGUI.hpp>
int main() {
sf::RenderWindow window(sf::VideoMode(800, 600), "TGUI");
sf::CircleShape shape(100);
tgui::Gui gui{window};
auto theme = tgui::Theme::create("TGUI/widgets/Black.txt");
//tgui::Button::Ptr bClickMe = tgui::Button::create("Click me!");
tgui::Button::Ptr bClickMe = theme->load("Button");
bClickMe->setText("lol");
bClickMe->setPosition("50%", 100);
gui.add(bClickMe);
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
if (event.type == sf::Event::Closed || event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape) {
window.close();
}
gui.handleEvent(event);
}
window.clear(sf::Color(128, 128, 128));
window.draw(shape);
gui.draw();
window.display();
}
}