Hello,
When I resize my rendering windows, the CEGUI cursor position become different than the actual mouse position. I am using the DirectX9 render, and don't know if I forget to initialize anything. I have test the samples which come with the SDK, and all of them work fine when I resize the rendering windows. I have checked the forum and I find out that someone have the same problem long time ago
http://www.cegui.org.uk/phpBB2/viewtopic.php?t=755&start=0&postdays=0&postorder=asc&highlight=resize
and I try to use the same method to resolve the problem but I found out that some of the functions are obsoleted already. Can anyone give me some ideas about this? Thanks!
Incorrect cursor position after resize the rendering window
Moderators: CEGUI MVP, CEGUI Team
It's a bit late for this reply, but I've just had to solve the same problem and CE's post was helpful to me. Here are the specifics of how I resolved the problem of resizing the GUI to match with the newly resized viewport. Note that I'm using Ogre 1.4.x.
I hope this is able to help someone.
Code: Select all
void MyApp::ResizeGUIToRenderWindow(void)
{
Ogre::Viewport* vp = mCamera->getViewport();
mGUIRenderer->setDisplaySize(CEGUI::Size(Ogre::Real(vp->getActualWidth()), Ogre::Real(vp->getActualHeight())));
mMainGuiSheet->setMaxSize(CEGUI::UVector2( CEGUI::UDim(0, Ogre::Real(vp->getActualWidth())), CEGUI::UDim(0, Ogre::Real(vp->getActualHeight()))));
mMainGuiSheet->setSize(CEGUI::UVector2( CEGUI::UDim(0, Ogre::Real(vp->getActualWidth())), CEGUI::UDim(0, Ogre::Real(vp->getActualHeight()))));
CEGUI::MouseCursor::getSingleton().setConstraintArea(NULL);
}
I hope this is able to help someone.
Arcanoria - a SMORPG project - http://www.arcanoria.com
Who is online
Users browsing this forum: No registered users and 2 guests