Jump to content

guiGetScreenSize()


Recommended Posts

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.

Link to comment

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).

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...