loading gui sheet doesn't work
Posted: Mon Mar 09, 2009 03:25
Hi everybody!
I have the following problem with my code. I load a layout for the main menu with the following code:
This layout has a background picture and four buttons. Now after pressing one of those buttons I want to load a different layout. I do this with the following code:
Now this window doesn't load for some reason. The screen just freezes, so I tried to load the ogregui.layout file instead like:
This works fine. So I thought I might have done something wrong with my second layout, so I tried to make a new layout with only one button and I tried to load this and it froze again. I really don't know why it doesn't load the other layout if it is one of mine. It loads the ogregui layout. It's just weird.
Am I doing something wrong? Do I have to destroy the first window before loading the second one? I don't know.
Any help would really be appreciated.
Btw I used the CE Layout Manager to create the layouts.
Thanks in advance!
I have the following problem with my code. I load a layout for the main menu with the following code:
Code: Select all
CEGUI::Window *sheet = CEGUI::WindowManager::getSingleton().loadWindowLayout((CEGUI::utf8*)"mainMenu.layout");
//load image into the staticImage holder
CEGUI::Window *background = CEGUI::WindowManager::getSingleton().getWindow("imageBackground");
CEGUI::ImagesetManager::getSingletonPtr()->createImagesetFromImageFile("BackgroundImage", "Background.tga");
CEGUI::DefaultWindow *staticImage = static_cast<CEGUI::DefaultWindow*>(background);
staticImage->setProperty("Image", "set:BackgroundImage image:full_image");
mSystem->setGUISheet(sheet);
This layout has a background picture and four buttons. Now after pressing one of those buttons I want to load a different layout. I do this with the following code:
Code: Select all
CEGUI::Window *sheet = CEGUI::WindowManager::getSingleton().loadWindowLayout((CEGUI::utf8*)"pilotLog.layout");
//load image into the staticImage holder
CEGUI::Window *background = CEGUI::WindowManager::getSingleton().getWindow("pilotLogimageBackground");
CEGUI::ImagesetManager::getSingletonPtr()->createImagesetFromImageFile("BackgroundImage", "Background.tga");
CEGUI::DefaultWindow *staticImage = static_cast<CEGUI::DefaultWindow*>(background);
staticImage->setProperty("Image", "set:BackgroundImage image:full_image");
mSystem->setGUISheet(sheet);
Now this window doesn't load for some reason. The screen just freezes, so I tried to load the ogregui.layout file instead like:
Code: Select all
CEGUI::Window *sheet = CEGUI::WindowManager::getSingleton().loadWindowLayout((CEGUI::utf8*)"ogregui.layout");
mSystem->setGUISheet(sheet);
This works fine. So I thought I might have done something wrong with my second layout, so I tried to make a new layout with only one button and I tried to load this and it froze again. I really don't know why it doesn't load the other layout if it is one of mine. It loads the ogregui layout. It's just weird.
Am I doing something wrong? Do I have to destroy the first window before loading the second one? I don't know.
Any help would really be appreciated.
Btw I used the CE Layout Manager to create the layouts.
Thanks in advance!