Chaz-CR Posted April 30, 2015 Posted April 30, 2015 Hello everybody, i was trying to add some labels to the screen about normal information (Location, Server Name, Fps and Ping). So I found out that they has guiGetScreenSize but when I change the resolution it seems weird. Not as I made it. So I wanted to know how to make the "maths" of this function to get the same place in different resolutions. CODE I MADE. addEventHandler("onClientRender", root, function() local sx,sy = guiGetScreenSize() dxDrawText("AGE Of BATTLES", sx*673/800, sy*550.5/600, sx*0/800, sy*0/600, tocolor(0, 109, 132, 255), 1.3, "pricedown", "left", false, false, false, false, false, false) end )
MTA Team botder Posted April 30, 2015 MTA Team Posted April 30, 2015 Do you change your resolution by restarting MTA or do you use some kind of resize hack? The second option will not work.
HunT Posted April 30, 2015 Posted April 30, 2015 Get the relative position with gui editor easy. Ex: sx*0.1 sy*0.1
ALw7sH Posted April 30, 2015 Posted April 30, 2015 local sx,sy = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawText("AGE Of BATTLES", sx*(673/800), sy*(550.5/600), sx*(0/800), sy*(0/600), tocolor(0, 109, 132, 255), 1.3, "pricedown", "left", false, false, false, false, false, false) end )
Enargy, Posted May 1, 2015 Posted May 1, 2015 or simply you just get original position of the text local sx, sy = guiGetScreenSize(); x, y = (sx/800), (sy/600) dxDrawText("AoB", sx*271, sy*500, 50, 50, ...)
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