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

Messages - ungod

#1
Feature requests / Re: tgui::PictureRenderer
06 September 2017, 11:29:09
Haha, it should be more accurate than my implementation then. Thanks for your efforts. :)

btw this ignoreMouseEvents thing is also very pleasant to have. Nice update.
#2
Feature requests / Re: tgui::PictureRenderer
05 September 2017, 14:23:44
I recently found myself in the scenario where I have complex (in a visual sense) widgets for a game. That means widgets are often groups of base widgets, lets say a progressBar for health, decorated with pictures, lets say small icons for status effects. I think like these kind of pictures are indeed part of "how widgets look in general".
(Take in mind, that tgui::Picture is by definition a tgui::Widget anyway :P).
It felt unclean to have some of the gui textures defined in a theme file and some hardcoded in C++.
#3
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. :)
#4
Help requests / Re: Broken Layouts?
02 September 2017, 13:38:45
It worked and yes, my github version was a few days (too) old. :)
#5
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.