About Store Forum Documentation Contact



Post Reply 
Question about resolution independet gui
Author Message
Impz0r Offline
Member

Post: #1
Question about resolution independet gui
Hey there,

as the topic states, I've a question regarding resolution intepended gui developing. Within the gui editor you've the option to show screen proportions and thoese a split into couple screen formats like 1:1, 5:4, 4:3, 16:10.

Well i was wondering, if I develop a gui fitting into the 5:4 proportion, how to I make it fit into something like 16:10. Take an intro screen as an example, it should fit the whole screen no matter what resoulution the player has choosen, same for the ingame gui, etc.. How is this commonly achived?

Do i have to rescale the gui by code every time the user changed his resolution?

Thanks in advance.

Mfg Imp
06-21-2010 09:56 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Question about resolution independet gui
use D.screenchanged to detect resolution changes, inside it you can reposition gui elements
06-21-2010 10:16 PM
Find all posts by this user Quote this message in a reply
Rofar Offline
Member

Post: #3
RE: Question about resolution independet gui
My solution is to create everything in the GUI Editor as if the screen is 1:1 and then handle the screenchanged event. I have a bunch of code that moves and scales gui objects. My code first resets all components to the 1:1 orginal size/placements and then re-adjusts based on the new proportions.
06-21-2010 11:10 PM
Find all posts by this user Quote this message in a reply
Impz0r Offline
Member

Post: #4
RE: Question about resolution independet gui
Thanks to you both.

Sadly that there is not automatic repositioning of the gui controls. It's rather clunky to reposition all controls by hand anytime the resolution has changed. Makes the gui editor rather pointles to some degree.

Well then.. repositioning by code it is.


Mfg Imp
06-22-2010 03:33 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #5
RE: Question about resolution independet gui
I agree... The project I'm working on is Gui intensive and it is painful keeping everything in position. I don't bother using the GUI Editor as it is too clunky. I just hard code everything.

I believe the whole problem could be solved very easily by adding anchoring to the Gui system. In other words, you position your control and then can specify what it anchors to both vertically and horizontally. So you could set bottom, right for example. Then the control will stay in the same position relative to the bottom, right corner of the screen regardless of the resolution, shape or size of the window.
06-22-2010 02:36 PM
Find all posts by this user Quote this message in a reply
Sarrene Offline
Member

Post: #6
RE: Question about resolution independet gui
Silly question, but what about adding an XML component that you can use to build the gui from?

If you set esenthel c++ variables- the usecontrole, search keys, events, settings, layout, tooltips, game variable, elements, etc. (I could ramble on for a while) in the engine itself, what about allowing the engine to read the xml and output what you do on the screen for the client?

I might be way off on this, but it is just an idea. I know most engines i have worked on used xml as the gui design output, and c++, lua, and even python as the controllers for the scripts/code.

wink The nice thing i found with xml based gui/ui's is that once the controllers and search keys are in the engine, it makes the job of placing the elements and even graphics where you want them to go. Also makes editing a lot easier.. especially from a graphic designers point of view.

I do not know if that makes any sense, as I have a difficult time explaining at times what is in my head. But if anyone understands what I mean, please feel free to pick up where i left off at, or correct me where I need correcting.

Peace,
Sarrene'
06-23-2010 08:04 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Impz0r Offline
Member

Post: #7
RE: Question about resolution independet gui
Someone has worked with CEGUI i suppose wink

I did too sometime back, and it was a pain I've to admit. Atleast the integration part, the ui building by editor/hand was quite ok. So, yes I think an xml-based gui makes quite some sence in a couple of ways.

The current gui system in place is somehow narrowed that i was wondering if it is possible to integrate something like Awesomium or Berkelium. Why create a gui system from ground up, if you can use something allready in place. And even something which is extremely flexible.

I guess i just suggested a feature request pfft


Mfg Imp
06-23-2010 04:03 PM
Find all posts by this user Quote this message in a reply
Impz0r Offline
Member

Post: #8
RE: Question about resolution independet gui
About the repositioning I found a rather "easy" solution, which seems to work. I do have a gui file for every aspect ratio I want to support and if the resolution changed / aspect ratio, I do reload the appropriate gui file and be done with it.

Besides that, I also like to see something like alignment. That would be really helpful in some cases.


Mfg Imp
(This post was last modified: 06-25-2010 12:21 AM by Impz0r.)
06-25-2010 12:17 AM
Find all posts by this user Quote this message in a reply
Post Reply