Markeloff Posted April 4, 2014 Posted April 4, 2014 Hello, I need help with screen sizes stuffs, I want tips and ways on howto make gui and dx fit on every resolutions. About the wiki, I already tested the ways there. They can't help me doing what I need. I really need help. Here is what I did, local sX,sY = guiGetScreenSize() dxDrawText("Test", sX*(267/1024), sY*(94/768), sX, sY, tocolor(135, 248, 236, 223), relativeWidth*3.00, "pricedown", "left", "top", false, false, true, false, false) or this local screenWidth, screenHeight = guiGetScreenSize() local relativeWidth, relativeHeight = screenWidth / 1024, screenHeight / 768 dxDrawText("Test", relativeWidth*267, relativeHeight*94, relativeWidth, relativeHeight, tocolor(r[1], g[1], b[1], 255), 1.30, fa, "left", "top", false, false, true, false, false) Btw, I use the same ways for every dx and gui elements.
Dealman Posted April 4, 2014 Posted April 4, 2014 sX*(267/1024) This is the right way of doing it, you need to do it for both positions and scale.
Markeloff Posted April 4, 2014 Author Posted April 4, 2014 For scale, I use screen height or weight to multiply with? That way is working for dx rectangles and lines?
Dealman Posted April 4, 2014 Posted April 4, 2014 Example of how I do it; dxDrawText("You Died!\nRespawning in "..tostring(respawnTimer/1000).." Seconds!", screenX*(547/1360), screenY*(507/768), screenX*(841/1360), screenY*(563/768), tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "top", false, false, true, false, false) This should work for anything using absolute coordinates(pixels).
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