Re: [GD-General] GUI Design
Brought to you by:
vexxed72
From: mike w. <mi...@ub...> - 2003-01-24 17:32:38
|
what we do with our engine is read the coordinates differently based on whether they are positive or negative values. so if you have a hud or menu item that has a positive coordinate, then the item is positioned that far from the top or left hand side of the screen. if it is a negative value, then it's from the bottom or right hand side of the screen. so a layout like this gives us something that is 10 pixels from the left hand side of the screen, 35 pixels from the bottom... [health] type = numeric frame = healthindicator.bmp framealpha = a_healthindicator.bmp framex = 10 framey = -35 indicatoroffsetx = 35 indicatoroffsety = -10 font = 14 width = 3 and this entry gives me a hud indicator that is 100 pixels from the right hand side of the screen, and -35 pixels from the bottom. works well, and your hud auto-scales to all resolutions (within reason). [pistol_shell] type = numeric style = magazine frame = bulletindicator.bmp framealpha = a_bulletindicator.bmp framex = -100 framey = -35 indicatoroffsetx = 10 indicatoroffsety = -10 font = 14 width = 3 active = false you can get the source code that details how this is done (as well as the rest of our engine) from our project site at http://rfactory.uber-geek.ca hope this helps cheers mike w www.uber-geek.ca ----- Original Message ----- From: "Chris Brodie" <Chr...@ma...> To: <gam...@li...> Sent: Wednesday, January 22, 2003 4:14 PM Subject: [GD-General] GUI Design > I've been building a GUI for my game but from day 1 have had a design issue I've been ignoring. From the beginning I've coded the coordinate system to OpenGL's bottom left origin. This is a minor pain as I'm the only one who needs to worry about the coordinates in the menu xml files (for now). > > The problem however is when I resize the screen everything remains squished in the bottom left corner of the screen. The only ay I can think of solving the problem so it looks 'normal' is to provide some kind of virtual scaling system that the menu is designed against that is then translated in to screen coordinates. For example I could use something simple like 100% equalling the width of the screen, so a box might be 20% wide 15% high at position 5%,5%. > > How have you guys solved this problem? My solution presented seems like it'll add a whole lot more math to the GUI to do all the translations for the virtual screen space. > > Thoughts? > > Chris Brodie > > > NOTICE > This e-mail and any attachments are confidential and may contain copyright material of Macquarie Bank or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Macquarie Bank does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Macquarie Bank. > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Scholarships for Techies! > Can't afford IT training? All 2003 ictp students receive scholarships. > Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. > www.ictp.com/training/sourceforge.asp > _______________________________________________ > Gamedevlists-general mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-general > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=557 > |