setVisible should be set to the value which "Visible" has.
Yes, but isn´t this false after
Code: Select all
io::IAttributes* attr = FileSystem->createEmptyAttributes(Driver);
attr->read(reader, true);
?
But also note that new elements are always drawn on top
The point is: I don´t see any GUI.
I think that really is the problem, as this code:
Code: Select all
gui::IGUIStaticText *tex = GetGUIEnv()->addStaticText(L"", core::rect<s32>(core::vector2di(0,0), options.Screen));
tex->setVisible(true);
GetGUIEnv()->addButton(core::rect<s32>(core::vector2di(0,0), core::dimension2di(20,20)), tex);
GetGUIEnv()->loadGUI(filepath.c_str(), tex);
tex->setVisible(true);
tex->setMinSize(options.Screen);
at least let´s me see a black screen instead of the colour I use at driver->beginScene(). May it be the case that I don´t see the rest of the GUI because when the children of my root are created, this is invisible and they inherit this value?
EDIT:
I also had to notice that the size was reset to a dummy value. Therefore I made some quick change to
void CGUIEnvironment::readGUIElement(io::IXMLReader* reader, IGUIElement* node):
Code: Select all
case io::EXN_ELEMENT:
if (!wcscmp(L"attributes", reader->getNodeName()))
{
// read attributes
io::IAttributes* attr = FileSystem->createEmptyAttributes(Driver);
attr->read(reader, true);
attr->addBool("Visible", true); //!!!
attr->addRect("Rect", core::recti(0,0,800,600)); //!!!
if (node)
node->deserializeAttributes(attr);
attr->drop();
}
After those changes, I can see the GUI again, so it there seems to be a strong link between my problem and that dummy-value-reset which seems to take place. Or am I wrong?