Window being cut off

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

mboeni
Not too shy to talk
Not too shy to talk
Posts: 38
Joined: Wed Sep 08, 2010 16:02

Window being cut off

Postby mboeni » Wed Sep 15, 2010 12:33

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

mboeni
Not too shy to talk
Not too shy to talk
Posts: 38
Joined: Wed Sep 08, 2010 16:02

Re: Window being cut off

Postby mboeni » Thu Sep 16, 2010 09:10

Addendum: This only happens when I set the position programmatically. When set in the layout (xml) the 'cutting off' does not happen... :shock:

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Window being cut off

Postby CrazyEddie » Thu Sep 16, 2010 11:10

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.

mboeni
Not too shy to talk
Not too shy to talk
Posts: 38
Joined: Wed Sep 08, 2010 16:02

Re: Window being cut off

Postby mboeni » Thu Sep 16, 2010 11:35

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

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Window being cut off

Postby CrazyEddie » Tue Sep 21, 2010 09:05

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.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Window being cut off

Postby CrazyEddie » Wed Sep 29, 2010 08:59

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.


Return to “Help”

Who is online

Users browsing this forum: Google [Bot] and 10 guests