Nothing amazing but I thought that it'd be cool show it off
![Mr. Green :mrgreen:](./images/smilies/icon_mrgreen.gif)
The libs I used are in the description.
Thanks. I said that because all the libs are pretty well coded (and most of them are known to be working well alongside Irrlicht) so I just had to tweak the examples. The only thing that is quite annoying is when a problem or a bug is linked to many libs, it's hard to debug because there are not that much information about libs working together.chronologicaldot wrote:What? Nothing amazing? Aww.... Just kidding.
You've certainly tackled integration. Good job
Just to spare you some pain, don't try to implement the tooltips with the last version of CEGUI. They don't work (at least for me and another guy from the CEGUI forum).aaammmsterdddam wrote:Certainly a nice integration, I was just about to tackle CEGUI myself :3
thanks, I'll keep that in mind (didn't have any thoughts of implementing them as of now but I might get that idea)Nyx Erebos wrote:Just to spare you some pain, don't try to implement the tooltips with the last version of CEGUI. They don't work (at least for me and another guy from the CEGUI forum).aaammmsterdddam wrote:Certainly a nice integration, I was just about to tackle CEGUI myself :3
For now I don't want to share the whole code because it's quite poorly writtenLordJonas wrote:Any chance of you posting a link to the code? I'm very interested in the integration with CEGUI...
Code: Select all
/*
* This will create and initialise the following objects :
*- CEGUI::IrrlichtRenderer
*- CEGUI::IrrlichtResourceProvider
*- CEGUI::IrrlichtImageCodec
*- CEGUI::System
*/
/*IrrlichtRenderer& guiRenderer = */IrrlichtRenderer::bootstrapSystem(*device);
IrrlichtResourceProvider * IRprovider = static_cast<IrrlichtResourceProvider*>(System::getSingleton().getResourceProvider());
IRprovider->setResourceGroupDirectory("schemes",resourcesPath+"schemes");
IRprovider->setResourceGroupDirectory("imagesets",resourcesPath+"imagesets");
IRprovider->setResourceGroupDirectory("fonts",resourcesPath+"fonts");
IRprovider->setResourceGroupDirectory("layouts",resourcesPath+"layouts");
IRprovider->setResourceGroupDirectory("looknfeels",resourcesPath+"looknfeel");
IRprovider->setResourceGroupDirectory("lua_scripts",resourcesPath+"lua_scripts");
ImageManager::setImagesetDefaultResourceGroup("imagesets");
Font::setDefaultResourceGroup("fonts");
Scheme::setDefaultResourceGroup("schemes");
WidgetLookManager::setDefaultResourceGroup("looknfeels");
WindowManager::setDefaultResourceGroup("layouts");
ScriptModule::setDefaultResourceGroup("lua_scripts");
CEGUI::SchemeManager::getSingleton().createFromFile("TaharezLook.scheme");
Font* CEGUIFont = &(CEGUI::FontManager::getSingleton().createFromFile("DejaVuSans-10.font"));
System::getSingleton().getDefaultGUIContext().setDefaultFont( "DejaVuSans-10" );
System::getSingleton().getDefaultGUIContext().getMouseCursor().setDefaultImage("TaharezLook/MouseArrow");
System::getSingleton().getDefaultGUIContext().getMouseCursor().setVisible(true);
//creating the root window which is invisible
WindowManager& wmgr = WindowManager::getSingleton();
Window* myRoot = wmgr.createWindow( "DefaultWindow", "root" );
System::getSingleton().getDefaultGUIContext().setRootWindow(myRoot);
//menu
Window* myMenu = wmgr.createWindow( "DefaultWindow", "menu" );
myRoot->getRootWindow()->addChild(myMenu);
myMenu->setVisible(false);
myMenu->deactivate();
//interface
Window* myInterface = wmgr.createWindow( "DefaultWindow", "interface" );
myRoot->getRootWindow()->addChild(myInterface);
//creating a test window
FrameWindow* fWnd = static_cast<FrameWindow*>(wmgr.createWindow( "TaharezLook/FrameWindow", "testWindow" ));
//add the new window to the menu
myMenu->addChild(fWnd);
// position a quarter of the way in from the top-left of parent.
//UDim(scale,offset) | scale in %, offset in pixels
fWnd->setPosition( UVector2( UDim( 0.25, 0 ), UDim( 0.25, 0 ) ) );
// set size to be half the size of the parent
fWnd->setSize( USize( UDim( 0.5, 0 ), UDim( 0.5, 0 ) ) );
fWnd->setText( "Hello World!" );
//the menu window can't be modified by the mouse
myMenu->setMousePassThroughEnabled(true);
Code: Select all
case irr::KEY_KEY_0:
CEGUI::System::getSingleton().getDefaultGUIContext().injectChar(0x0030);
return true;
case irr::KEY_BACK:
CEGUI::System::getSingleton().getDefaultGUIContext().injectKeyDown(CEGUI::Key::Backspace);
//for now the keyup is here (put it into the Irrlicht keyup)
CEGUI::System::getSingleton().getDefaultGUIContext().injectKeyUp(CEGUI::Key::Backspace);
return true;
Code: Select all
System::getSingleton().getDefaultGUIContext().injectMouseButtonDown(LeftButton);
Code: Select all
CEGUI::System::getSingleton().injectTimePulse(deltaTime*0.001);