Can't resize menu

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
das heck
Posts: 6
Joined: Thu Feb 11, 2010 12:14 pm

Can't resize menu

Post by das heck »

Hi,

I have an application which is initially set to a resolution of 800*600 px. IN that windo I create a menu. So the menu has a width of 800 px. But when I manually resize the window the menu still remains with 800 px. So I did the following. In each renderloop I do this:

Code: Select all

if(lastScreenSize != driver->getScreenSize())
	{
		lastScreenSize = driver->getScreenSize();

		cout << menu->getAbsolutePosition().getWidth() << endl;
		menu->setMaxSize(dimension2d<unsigned int>(lastScreenSize.Width, 42));
		menu->setMinSize(dimension2d<unsigned int>(lastScreenSize.Width, 42));
		cout << menu->getAbsolutePosition().getWidth() << endl;
	}

	menu->draw();
menu->getAbsolutePosition().getWidth() returns the correct value (e.g. first 800 and then 1280 but the menu is still drawn with a width of 800 px. Take a look:

Image[/img]
Image

RPGBomber - A bomberman like game
  • System: 80%
  • Game: 20%
  • Map editor: 90%
Check this website for current release: http://www.rpdev.net
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

You shouldn't have to do this. When the window is resized, the root GUI element is also resized. The menu and toolbars are set to fill their parent, so they should also resize automatically.

Are these children of something other than the root GUI element? If not, it could be a bug with the Windows device.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply