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 - doomista

#1
I have a tgui::Canvas object, to which I connected events using "MousePressed":

auto canvas = tgui::Canvas::create();
canvas->connect("MousePressed", [this]() { /*...*/ });


But it seems the event is only triggered on left mouse click, not on right mouse click.

Is there any way to trigger on both?
#2
Feature requests / setTextureRect on Renderers
29 August 2019, 12:23:31
Could you please add function setTextureRect to Renderers such as ButtonRenderer with the same semantics as sf::Sprite::setTextureRect?
So far, I cannot find a way how to display only a subset of a texture on a button.

Example usage:
auto btn = tgui::Button::create();
btn->getRenderer()->setTexture(myTilesetTexture); // tileset of 16x16 images
btn->getRenderer()->setTextureRect(sf::IntRect(16, 0, 16, 16)); // displaying second image
btn->setSize(16, 16);


Thanks
#3
Hi,

I ran into a problem when experimenting with themes bundled with tgui (v0.7). I have copied whole widgets folder to my project's folder. I managed to load theme Black.txt and create ChildWindow from it without any problems (using relative paths). But when I try to load either TransparentGrey or BabyBlue, program throws an exception at the moment where ChildWindow should be created.

The problem is not in paths. I have copied whole contents of TransparentGrey over original content of Black and program crashed too. I restored original Black's contents and program ran just fine. Also I've only copied ChildWindow section from TransparentGrey into Black and overwritten original Black's ChildWindow. That worked. So I assume that somewhere in both TransparentGrey and BabyBlue there is some syntax error.
#4
Hi,

I am working on a drawing application and I need buttons with icons of various tools (brush, can, etc) that change color based on color selection. So far I am doing it via sf::Sprite that has texture bound to it and calling Sprite::setColor whenever I need to. And I catch the clicks with invisible panel hidden behind it.

But that creates an issue since I have to draw the Sprites after the gui is drawn and thus any elements that possibly can overlap these buttons will be rendered under the Sprites. I was wondering whether I can use something like tgui::Picture to do the job, but unfortunately I can't find a way to access it's underlying sprite (or whatever it uses for rendering).

In the end, Picture renders a texture so there has to be a way to set color to it as well.
Thanks for any tips