RE: [GD-General] GUI Design
Brought to you by:
vexxed72
From: Tom F. <to...@mu...> - 2003-01-23 11:34:21
|
We use a virtual resolution of 640x480, because it's easier for people to grok than 0-1. Also, it's easy to make sure stuff is at least roughly square. Then whether the actual rez is 640x448 or 800x600 or whatever, it's all scaled accordingly. It's zero cost for the GPU to rescale that to whatever coordinates it wants - you just wrap it up in the projection matrix. For GUIs with lots of text, it may be better to work in screen space, but have each part of GUI "seek" towards a particular corner or edge (middle-top of screen for example). So when giving coordinates in 640x480 space, you always say which of the 9 (including the middle of the screen) positions its relative to. Then the position ad size doesn't get scaled, it stays the same size and moves along with its reference point. Tom Forsyth - Muckyfoot bloke and Microsoft MVP. This email is the product of your deranged imagination, and does not in any way imply existence of the author. > -----Original Message----- > From: Jason Maynard [mailto:jma...@li...] > Sent: 23 January 2003 00:46 > To: gam...@li... > Subject: Re: [GD-General] GUI Design > > > > Yeah I would recommend using values between 0.0 and 1.0 as a > percentage of > the width or height of the screen like you said, you can > convert to actual > screen coordinates by just multiplying the the screen width > or height then. > > Another option is to design the GUI layout in a fixed > resolution and then to > convert them into a different resolution apply a scaling > factor. Say you > have a point (x,y) in 640x480 layout and your screen is in > resolution WxH, > then to find the point (x',y') in screen space: > > x' = x * (W / 640); > y' = y * (H / 480); > > -Jason > > ----- 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 > > > > ------------------------------------------------------- > 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 > |