Hello. I was trying to compile this code:
The "widgets" and "fonts" folders are in the same folder as the app is. What might be the problem?
This is TGUI v0.6 of course.
Code Select
#include <TGUI/TGUI.hpp>
int main()
{
// Create the window
sf::RenderWindow window(sf::VideoMode(800, 600), "Window");
tgui::Gui gui(window);
// Load the font (you should check the return value to make sure that it is loaded)
gui.setGlobalFont("fonts/DejaVuSans.ttf");
tgui::Button::Ptr button(gui, "btnTileset");
button->load("widgets/Button/BabyBlue");
button->setText("Tileset");
button->setSize(80, 20);
button->setPosition(4, 4);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
// Pass the event to all the widgets (if there would be widgets)
gui.handleEvent(event);
}
window.clear();
// Draw all created widgets
gui.draw();
window.display();
}
return EXIT_SUCCESS;
}
The "widgets" and "fonts" folders are in the same folder as the app is. What might be the problem?
This is TGUI v0.6 of course.