itHyperoX Posted September 18, 2017 Posted September 18, 2017 (edited) 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: lower that 1920 x 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 September 18, 2017 by TheMOG
DiGiTal Posted September 18, 2017 Posted September 18, 2017 Hi, You have to read this. https://forum.multitheftauto.com/topic/96776-tut-scaling-drawinggui-elements-for-all-resolutions/
itHyperoX Posted September 18, 2017 Author Posted September 18, 2017 its like smaller than original. Is there any way to make it like the same , but fit all resolution?
Dimos7 Posted September 18, 2017 Posted September 18, 2017 (edited) 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 September 18, 2017 by Dimos7
Anubhav Posted September 19, 2017 Posted September 19, 2017 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.
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