Use MyGUI ItemBox
Posted: Fri Dec 23, 2016 6:05 pm
I would like to use ItemBox to show Images. But I don't know how to make it right.
The ItemBox from demo is very hard: there are many classes for this easy thing.
I've crated ItemBox(I see it on the screen). And I would like to add ImageBox on it.
In follow code i is a for-loop variable
But the ItemBox is empty.
I've tried to create item like this:
Now it's shows elements, but on the itembox, not in. There is no scroll bar and the itembox doesn't set them grid positions.
The ItemBox from demo is very hard: there are many classes for this easy thing.
I've crated ItemBox(I see it on the screen). And I would like to add ImageBox on it.
In follow code i is a for-loop variable
Code: Select all
auto item = new MyGUI::ImageBox();
item->setImageTexture("photo.png");
itemBox->insertItemAt(i,item);I've tried to create item like this:
Code: Select all
auto item = itemBox->createWidget<MyGUI::ImageBox>("ImageBox",
itemBox->getHeight() * i,0,
itemBox->getHeight() / 2,itemBox->getHeight() / 2,
MyGUI::Align::Default, "");