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

#1
Help requests / Re: Grid
14 March 2019, 20:59:46
Ok, yeah for the instance I showed with only the grid in it, but in my program I have more than one :)

So I tested with the fix and it works great, thanks for your support !
#2
Help requests / Re: Grid
14 March 2019, 19:54:59
Ok thanks for your answer, i will check it out very soon.

Is there a way to compact the widgets in the upper left corner with that layout ? With tgui::Grid::Alignement::UpperLeft when using addWidget() maybe ?
I would like to have something organized like this : (6.png).
#3
Help requests / Grid
14 March 2019, 09:39:20
Hello,

I'm currently trying to use Grid but I'm facing weird behavior.

The spacing between my widgets in the grid are way too important if I'm trying to create more than one row. So, my widgets are overflowing my parent container.
The grid is in vertical layout, and the vertical layout is in a Group::Ptr.

I've took multiple screenshots :

Screen with 5 widgets, 5 per row : "5elm-5pr.jpg"
Screen with 6 widgets, 5 per row : "6elm-5pr.jpg"
Screen with 12 widgets, 5 per row : "12elm-5pr.jpg"

And here is the code :

Code (cpp) Select

container_ = tgui::Group::create({ "30%", "100% " });
container_->setPosition({ "70%", "0%" });

verticalLayout_ = tgui::VerticalLayout::create();

tgui::Button::Ptr button = tgui::Button::create("");
button->getRenderer()->setTexture(ResourceManager::GetInstance().getTextureByName("panel"));
button->setSize(75, 75);

grid_ = tgui::Grid::create();

for (int i = 0; i < 12; ++i) {
tgui::Button::Ptr butt = tgui::Button::copy(button);
grid_->addWidget(butt, i / 5, i % 5);
}

verticalLayout_->add(grid_);

container_->add(verticalLayout_);

Gui.add(container_);


As you can see, the "5elm-5pr.jpg" is ok because the row number is always equals to "0". But when I'm trying to create more than row (e.g "6elm-5pr.jpg"), everything explodes.

Am i missing something ?

Thanks

EDIT :

I found out that this problem occurs only when the grid is in the vertical layout (c.f . 6elm-5pr-without-verticallayout.jpg").
But I would like to keep that layout. Is there a solution to compact the grid when it used in the layout ?
#4
Help requests / Re: Set widget to unclickable
06 March 2019, 21:03:28
Oh okay, I understand.
Indeed, it works with setEnabled, thanks for your answer !
#5
Help requests / Set widget to unclickable
06 March 2019, 15:18:08
Hello everyone,

How can I make a widget unclickable (e.g. with a tgui::Label) ? And by that, I mean tgui::handleEvent() stops returning me true when I click/hover to the widget.
I tried with ignoreMouseEvents(), but the tgui::handleEvent() keeps returning me true.

Thanks