Main Menu
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

Topics - ungod

#1
Feature requests / tgui::PictureRenderer
05 September 2017, 11:54:14
Hi,

is there a particular reason why tgui lacks a specific renderer for Pictures? I've added such a thing myself with just a "Texture" property, because its convenient to define what pictures show in a theme file and not rely on hardcoding.

It would be nice if a PictureRenderer is added officially. Should not be very time-consuming. :)
#2
Help requests / Broken Layouts?
01 September 2017, 09:30:27
Hi,

I cant figure out why the following code is not working. I'm using the latest dev version 0.8.
My problem occurs when I try to reference another widget (parent or sibling) in a layout-string.
It seems like the parsing it these cases is broken, or is something wrong with the code below?

Code (cpp) Select

#include <SFML/Graphics.hpp>
#include <TGUI/TGUI.hpp>
int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "gui test");
    window.setFramerateLimit(60);

    tgui::Gui gui(window);

    try
    {
        tgui::Theme theme{"data/Black.txt"};

        auto button1 = tgui::Button::create();
        auto button2 = tgui::Button::create();
        auto group = tgui::Group::create();

        group->add(button1, "button");
        group->add(button2);

        button1->setRenderer(theme.getRenderer("Button"));
        button2->setRenderer(theme.getRenderer("Button"));

        button2->setPosition({"button.right + 100", "button.top"});  //error here

        gui.add(group);

    }
    catch (const tgui::Exception& e)
    {
        std::cerr << "TGUI Exception: " << e.what() << std::endl;
        return -1;
    }

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();

            gui.handleEvent(event);
        }

        window.clear();
        gui.draw();
        window.display();
    }

    return 0;
}


edit: The version 0.8 from the website works fine, but the latest github version is buggy. Anyway, the problem might be worth noticing.