resizeWindow in VB.NET ?

Coolzero

01-05-2010 09:50:10

I've got a little problem :?

I create my gui in VB.NET (i don't use layouts). When i resize the window (let's say from 800x600 to 1024x768) the gui elements are fixed in there position.
I found a thread where they say to useMyGUI::Gui::windowResized(Ogre::RenderWindow* rw);
But in VB the function resizeWindow doesn't exist :(.

Altren

01-05-2010 12:42:56

First of all this function from MyGUI 2.* and doesn't exist in MyGUI 3.*
MyGUI::OgreRenderManager class (from OgrePlatform) is also Ogre::WindowEventListener and call resize any time when Ogre says that window was resized, so you probably should modify MyGUI::OgreRenderManager if Ogre not sending this event for some reason..

Coolzero

02-05-2010 20:37:37

Thank's altren, good to know :roll:

Now i resize the window with:
myWindow.Resize(width, height)

Now, the next problem is the aspect ratio from the widgets, they are stretched or compressed (depending on the resolution).
I think i can calculate the size of the widgets mathematically in relation to the resolution, or is there any other way to do that ?

Altren

02-05-2010 21:46:54

This also breaks aspect ratio of everything in scene (not only GUI). You should also call (C++ code)mCamera->setAspectRatio(width / height); after resize.

Coolzero

03-05-2010 09:06:24

myCamera.aspectRatio doesn't seems to do anything. All 3d objects rendered fine regardless of the resolution.

As you can see, in the second image the widgets are stretched. This happens if the aspect ratio is not 4:3 like in the first image.

[attachment=1]800x600.jpg[/attachment][attachment=0]1280x720.jpg[/attachment]