Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Yuri12358

#1
Help requests / Re: Nothing is drawn
30 July 2017, 22:18:37
Thanks very much.
Btw, your library is awesome
#2
Help requests / Nothing is drawn
30 July 2017, 21:20:59
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();
}
}