Jump to content

screenX, screenY problem


itHyperoX

Recommended Posts

Hello, i trying to make a hud,  like in pubg, but for some reason, with low resolutions players can't see it.

How can i make it ? I want to make it the same size, not smaller or anything, just the same with 1920x 1080.

 

Here is the code:

local screenSize = {guiGetScreenSize()}
local screenX, screenY = screenSize[1]/2-1000/2, screenSize[2]/2-50/2


addEventHandler("onClientRender",root,function()

    dxDrawRectangle(screenX+400, screenY+520, 200, 30, tocolor(0, 0, 0, 135))
    
    dxDrawText("Test",screenX+1250/2,  screenY+1040/2, screenX+100/2, screenY+20/2, tocolor(255, 255, 255), 1, "pricedown", "left", "top", false, false, false, true)    
end
)

 

Here is the pic 1920x1080:

image.png

 

lower that 1920 x 

image.png

 

Thanks any help

 

How can i make it like the hud is the same for all resolutions? I don't want to use guieditor, i want to make it the hud looks like the same all resolutions

 

 

Edited by TheMOG
Link to comment
local screenW, screenH = guiGetScreenSize()
local sx, sy = screenW/1900, screenH/1080

addEventHandler("onClientRender", root,
  dxDrawRectangle(screenW/2 - 1000/2 + sx + 400, screenH/2 -50/2 + sy + 520, sx * 200, sy*30, tocolor(0, 0, 0, 135))
    dxDrawText("Test", screenW/2 -1000/2 + sx +1250/2, screenH/2 -50/2 + sy+ 1040/2, screenW/2 - 1000/2 + sx + 100/2, screenH/2 - 50/2 + sy +20/2 , tocolor(255, 255, 255, 255), 1 ,"pricedown", "left", "top", false, false, false, true)
end
)

try that

Edited by Dimos7
Link to comment
19 hours ago, TheMOG said:

its like smaller than original.

Is there any way to make it like the same , but fit all resolution?

For every lower height, try to increase the Y by some value to have the same size.

It will have same size, and it should fit. You have to find the some value tho. 

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