Page 1 of 1
Window being cut off
Posted: Wed Sep 15, 2010 12:33
by mboeni
Hi all
Another strange problem I encountered: When I set a window position using this code:
Code: Select all
aboutDialog->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.25f, 0 ), CEGUI::UDim( 0.25f, 0 ) ) );
my window is cut off at certain positions when I move it around. When commenting out the above line, the window works properly again.
I have taken the above line from the "window tutorial" so i assume its righ. Is there a difference when using the Ogre renderer or so?
Here's a link to the picture showing the cut off window:
https://labs.0x06.net/masterc0der/attachment/ticket/6/screenshot09152010_142432103.jpg (Just ignore the certificate warning)
CHeers, Michel
Re: Window being cut off
Posted: Thu Sep 16, 2010 09:10
by mboeni
Addendum: This only happens when I set the position programmatically. When set in the layout (xml) the 'cutting off' does not happen...
Re: Window being cut off
Posted: Thu Sep 16, 2010 11:10
by CrazyEddie
It seems to be an issue with scissor rects or something not getting updated correctly. Is this with 0.7.2? Is there a parent window for 'aboutDialog' or is aboutDialog set as the root for this? If there is a parent window, what type is it?
It's clearly a bug, I'll try and look into it soon. Which render system are you using with Ogre?
CE.
Re: Window being cut off
Posted: Thu Sep 16, 2010 11:35
by mboeni
Hi CE
- Yes, I'm using 0.7.2
- The render system is Direct3D9
- Im using a MenuBar and a FrameThingie for the AboutDialog (actually based on the Static Text sample)
Here's the setup code:
Code: Select all
guiRenderer = &CEGUI::OgreRenderer::bootstrapSystem();
CEGUI::Imageset::setDefaultResourceGroup("Imagesets");
CEGUI::Font::setDefaultResourceGroup("Fonts");
CEGUI::Scheme::setDefaultResourceGroup("Schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("LookNFeel");
CEGUI::WindowManager::setDefaultResourceGroup("Layouts");
CEGUI::SchemeManager::getSingleton().create("VanillaSkin.scheme");
CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
uiRoot = wmgr.createWindow( "DefaultWindow", "uiRoot" );
CEGUI::System::getSingleton().setGUISheet(uiRoot);
CEGUI::Window *mainMenu = wmgr.loadWindowLayout("g0_mainmenu.layout");
uiRoot->addChildWindow(mainMenu);
and here I create the about dialog:
Code: Select all
bool generat0r::showAboutDialog(const CEGUI::EventArgs &e)
{
CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
//need to check if layout is already loaded - can only be loaded once
CEGUI::Window *aboutDialog;
if(!wmgr.isWindowPresent("generat0r_AboutDialog") )
{
aboutDialog = wmgr.loadWindowLayout("g0_aboutdialog.layout");
//aboutDialog->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.25f, 0 ), CEGUI::UDim( 0.25f, 0 ) ) ); // this is now done in the layout where it works!
CEGUI::Window* textComponent = (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow("generat0r/AboutDialog/StaticText");
textComponent->setText("This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!");
uiRoot->addChildWindow(aboutDialog);
CEGUI::PushButton* UI_CloseButton = (CEGUI::PushButton*)CEGUI::WindowManager::getSingleton().getWindow("generat0r/AboutDialog/CloseButton");
UI_CloseButton->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&generat0r::hideAboutDialog, this));
}
else
{
//aboutDialog = static_cast<CEGUI::Window*>(wmgr.getWindow("generat0r_AboutDialog"));
aboutDialog = static_cast<CEGUI::Window*>(uiRoot->getChild("generat0r_AboutDialog"));
aboutDialog->show();
aboutDialog->activate();
}
return true;
}
If you need the layouts too - let me know.
Cheers,
michael
Re: Window being cut off
Posted: Tue Sep 21, 2010 09:05
by CrazyEddie
Thanks for the information, I'll try and reproduce this soon, since if possible I'd like the fix to go in for the coming 0.7.3 release
CE.
Re: Window being cut off
Posted: Wed Sep 29, 2010 08:59
by CrazyEddie
I tried to reproduce this using the posted code and layouts taken from another thread, however I could not get the same behaviour
Any other info you could give (or a minimal - but fully functioning - test case that reproduces the behaviour) would be great
CE.