device size
device size
Is there any way to determine the size of the device created so that i can adjust my GUI when the window is resized? Thanks
If you tried the apropriate tutorial for it you would be on your way already
Code: Select all
// if you think real code is always interresting, read this line again
What are you trying, as you're being pretty vaque yourself.circusdan wrote:The only relevant tutorial was the GUI one which was pretty vague, and didnt mention anything about what im trying to do
Assuming (tutorial 5) you want to resize all your IGUI... components, I believe you should trigger or catch this EGDT_WINDOW_RESTORE message. At least that sounds logical too me as the device gets lost if you go out of from fullscreen. Because I don't see a message for sizing I think it will be triggered on resize too. Maybe the EET_USER_EVENT is interresting too.
However, if you meant the tutorial 14, basically it's the same but you need to learn the Win32 API. There you should concentrate on WM_SIZE. That you can catch in the switch and the size is either passed into the wParam OR (not and) the lParam. The HIWORD(wParam) and LOWORD(wParam) you can extract the new width and height.
Code: Select all
// if you think real code is always interresting, read this line again
-
- Posts: 199
- Joined: Tue Dec 09, 2008 2:55 am
I assume you mean you want the size of the window?
http://irrlicht.sourceforge.net/docu/cl ... river.html
getScreenSize()
http://irrlicht.sourceforge.net/docu/cl ... river.html
getScreenSize()
while(signatureEmpty){cout<<wittyComment();}
The usual trick is to put one gui-element with your default-size as parent. It can be invisible (for example a static-text without borders and background drawing). When the main-windows changes the size you resize this element with setRelativePosition. All it's childs will then be resized as well according to their alignment settings (you can change those with setAlignment).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm