View Single Post
08/14/15, 01:29 PM   #8
Wandamey
Guest
Posts: n/a
Originally Posted by Lodur View Post
What are the best practices for building a GUI that scales correctly?
from what i have experienced, i'd say the less you bother, the better it will look.
Just do thing so they look well proportionned on your screen, it should render the same for everybody.

try to change your UI scale in the UI settings of ESO to see that everything is handled without you having to touch anything.

you can lock/unlock the scaling of controls in special situations (text Inside a preformatted tooltip, etc...) but messing with the maths behind the scale is just asking for problems.

now i'm a bit limited to test things on many resolutions. But from the screenshot/videos i've seen, i'm confident the game looks the same whatever the screen size.

and the units, you answered yourself, they seem to be GUI size units

edit : scale is inherited from parents to children, so that's the only thing you have to care for : placing elements one according to the other (with raw dimensions), then scale the top one if needed.
If you need to do something that looks proportional to the window/screen you can use as raw dimensions something alongside of : width, height = yourproportion * GuiRoot:GetDimensions() -- didn't check the syntax, but you'll get the idea-- knowing that the result will be scalable again with SetScale()
But that may force you to use % for all children dimensions depending on what you're doing
Better start with fixed dimensions (choose it with the default scale UI setting) then later on you'll always be able to add an option to rescale if needed.

rereredit, idk if we can use something similar to $lang to conditionally set dimension of a "sub"ui according to some Guiroot sizes ranges (like bootstrap could do for example) but i don't see why not if you have some very specific needs to do something like that.

Last edited by Wandamey : 08/14/15 at 04:10 PM.
  Reply With Quote