koragg Posted June 22, 2017 Share Posted June 22, 2017 I already know how to fix dxDrawText functions for any resolution but is it possible to make the same for GUI windows? I have, for example, a map shop but it's ok only on my resolution (FHD). How can I make it rescale itself properly on smaller/bigger resolutions so that it will always be in the same spot and the same size on any screen resolution? I tried the same way as I did for dxDrawText but it doesn't work as good. Partially it works but not good enough. Link to comment
WorthlessCynomys Posted June 22, 2017 Share Posted June 22, 2017 (edited) Hello. Now... guis have a Relative argument, but that's :~ty, so DO NOT use it. Instead, you can do it like: local sx, sy = guiGetScreenSize() guiCreateWindow(sx*0.5, sy*0.5, sx*0.2, sy*0.2, "Window", false) This makes your gui's TOP LEFT CORNER be at the screen's 50% at width and height too, and your gui's size will be 20% of the screen at width and height as well. IMPORTANT: if you use this technique, make sure that the relative argument is set to FALSE. Edited June 22, 2017 by StormFighter I made some mistakes Link to comment
pa3ck Posted June 22, 2017 Share Posted June 22, 2017 20 minutes ago, StormFighter said: Hello. Now... guis have a Relative argument, but that's :~ty, so DO NOT use it. Instead, you can do it like: local sx, sy = guiGetScreenSize() guiCreateWindow(sx*0.5, sy*0.5, sx*0.2, sy*0.2, "Window", false) This makes your gui's TOP LEFT CORNER be at the screen's fifth percent at width and height too, and your gui's size will be 2% of the screen at width and height as well. IMPORTANT: if you use this technique, make sure that the relative argument is set to FALSE. That's basically the same as a relative GUI and something * 0.2 = 20%, not 2%. Link to comment
WorthlessCynomys Posted June 22, 2017 Share Posted June 22, 2017 1 minute ago, pa3ck said: That's basically the same as a relative GUI and something * 0.2 = 20%, not 2%. Yes, it basically the same as relative GUI, that's true, but relative GUI isn't that precise. I know it from experience. On the other hand, thank you for telling me about the mistakes, i edited it. Link to comment
koragg Posted June 22, 2017 Author Share Posted June 22, 2017 Hm, thanks guys. Gonna see what I come up with in the coming days. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now