CEGUI

OvermindDL1

09-02-2006 09:51:55

Quick question. Are there any known issues with displaying any CEGUI parts inside PLSM2? I ask because if I use octree, the code in this source that builds a cegui window, works fine; however, if I switch to the PLSM2 plugin, that same code does nothing and actually when I try to access it later to pull data from it (text box), it crashes.

The cegui windows are built with this code:

mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mScene);
mGUISystem = new CEGUI::System(mGUIRenderer);
CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Informative);

CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"TaharezLook.scheme");
mGUISystem->setDefaultMouseCursor((CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
mGUISystem->setDefaultFont((CEGUI::utf8*)"Tahoma-12");

mEditorGuiSheet= CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"DefaultWindow",
(CEGUI::utf8*)"Sheet");
mGUISystem->setGUISheet(mEditorGuiSheet);

CEGUI::Window* win;
win = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/Button", (CEGUI::utf8*)"Quit");
mEditorGuiSheet->addChildWindow(win);
win->setPosition(CEGUI::Point(0.85f, 0.90f));
win->setSize(CEGUI::Size(0.1f, 0.06f));
win->setText("Quit");

win = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticText", (CEGUI::utf8*)"Instruction");
mEditorGuiSheet->addChildWindow(win);
win->setPosition(CEGUI::Point(0.38f, 0.20f));
win->setSize(CEGUI::Size(0.24f, 0.06f));
win->setText("Press Esc to play/pause");

**SNIP**


CEGUI::colour SelectColor(0.6, 0, 0.6);
CEGUI::ListboxTextItem* item;
item = new CEGUI::ListboxTextItem ("Set1");
((CEGUI::Listbox*)win)->addItem(item);
item->setSelected(true);
item->setID(3);
item->setSelectionColours(SelectColor);
item->setSelectionBrushImage("TaharezLook", "ListboxSelectionBrush");
item = new CEGUI::ListboxTextItem ("Set2");
((CEGUI::Listbox*)win)->addItem(item);
item->setID(2);
item->setSelectionColours(SelectColor);
item->setSelectionBrushImage("TaharezLook", "ListboxSelectionBrush");
item = new CEGUI::ListboxTextItem ("Set3");
((CEGUI::Listbox*)win)->addItem(item);
item->setID(1);
item->setSelectionColours(SelectColor);
item->setSelectionBrushImage("TaharezLook", "ListboxSelectionBrush");

mEditorGuiSheet->show();
mInputDevice->setBufferedInput(true, mGuiMode);
CEGUI::MouseCursor::getSingleton().show();

CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
wmgr.getWindow((CEGUI::utf8*)"Quit")->subscribeEvent(CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber(&Game::HandleQuit, this));

mDebugOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay");

if (mDebugOverlay)
{
mDebugOverlay->hide();
}


Any quick thoughts?

tuan kuranes

09-02-2006 10:16:57

CEgui initialisation has a scene manager type option, defaulted to octree, you have to change that.

OvermindDL1

09-02-2006 22:58:44

Ah, thank you much; I had not used CEGUI yet and was unsure how things interacted. I will tell him about it, thank you.