Jump to content

dx fits all resolutions


King12

Recommended Posts

I've made my dx window with guieditor, but it doesn't fit any resolutions since mine is 1920x1080

  
addEventHandler("onClientRender", root, 
function () 
dxDrawImage(1766, 0, 154, 1080, "images/background.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
dxDrawImage(1795, 925, 106, 100, "images/settings.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
dxDrawImage(1795, 143, 106, 100, "images/menu.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
dxDrawImage(1795, 522, 106, 111, "images/player.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
dxDrawText("The time is:", 1760, 21, 1931, 52, tocolor(0, 0, 0, 255), 0.80, "bankgothic", "center", "top", false, false, true, true, false) 
dxDrawText("The time is:", 1759, 20, 1930, 51, tocolor(255, 255, 255, 255), 0.80, "bankgothic", "center", "top", false, false, true, true, false) 
dxDrawText(timenow or "Updating..", 1759, 51, 1930, 82, tocolor(255, 255, 255, 255), 0.80, "bankgothic", "center", "top", false, false, true, true, false) 
end 
) 
  

Link to comment
  
local sx,sy=guiGetScreenSize() 
local ax,ay = 1024,760       -- your screen resolution x and y, mine is 1024, 760 
dxDrawImage(sx*(1795/ax),sy*( 522/ay),sx*( 106/ax),sy*( 111/ay), "images/player.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
  
dxDrawText("The time is:", sx*(1760/ax),sy*( 21/ay),sx*( 1931/ax),sy*( 52/ay), tocolor(0, 0, 0, 255), sx*(0.80/ax), "bankgothic", "center", "top", false, false, true, true, false) 

A tip from me: Go to google.com and look for "How to google?"

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