Jump to content

Dx Gui Help


jawwel

Recommended Posts

Hello everyone can someone help me set the gui to all resolution it only works on one

 

screenW, screenH = guiGetScreenSize()
resW, resH = 1366, 768
sW, sH = (screenW/resW), (screenH/resH)

example:

            dxDrawRectangle(0*sW, (i*45)-ground.scroll*sH, 43*sW, 43*sH, tocolor(255, 255, 255, 230))
            dxDrawImage(0*sW, (i*45)-ground.scroll*sH, 43*sW, 43*sH, "Imagenes/Inventario/Iconos/"..v[2]..".png", 0, 0, 0, tocolor(255, 255, 255))
            dxDrawRectangle(43*sW, (i*45)-ground.scroll*sH, 196*sW, 43*sH, tocolor(255, 255, 255, 200))
            dxDrawLine(0*sW, (i*45+42)-ground.scroll*sH, 513*sW, (i*45+42)-ground.scroll*sH, tocolor(255, 255, 255, 230), 2, false)
            dxDrawText(translateLocalization(v[2]), 48*sW, (i*45)-ground.scroll*sH, 194*sW, (i*45+45)-ground.scroll*sH, tocolor(255, 255, 255), 1, "default", "left", "center", false, false, false, false, false, 0, 0, 0);

 

Link to comment
sw, sh = guiGetScreenSize()
sx, sy = sw/1366, sh/768

function drawStuff()
    dxDrawRectangle(0*sx, (i*45)-ground.scroll*sy,43*sx, 43*sy, tocolor(255, 255, 255, 230))
	dxDrawImage(0*sx, (i*45)-ground.scroll*sy, 43*sx, 43*sy, "Imagenes/Inventarior/Iconos/"..v[2]..".png", sx*0, sy*0, sx*0, tocolor(255, 255, 255))
	dxDrawRectangle(43*sx, (i*45)-ground.scroll*sy, 196*sx, 43*sy, tocolor(255, 255, 255, 200))
	dxDrawLine(0*sx, (i*45+42)-ground.scroll*sy, 513*sx, (i*45+42)-ground.scroll*sy, tocolor(255, 255, 255, 230), sx*2, false)
	dxDrawText(translateLocalization(v[2]), 48*sx, (i*45)-ground.scroll*sy, 194*sx, (i*45+45)-ground.scroll*sy, tocolor(255, 255, 255), sx*1, "default", "left", "center", false, false, false. false, false, sx*0, sy*0, sx*0)
end
addEventHandler("onClientRender", root, drawStuff)

try this

Edited by Dimos7
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...