Sign in to follow this  
Followers 0
TheMOG

HUD

4 posts in this topic

Posted (edited)

Hi.

I'm trying to make a nice DXDRAW hud. I'm using the "guieditor" resource for that.

The problem is, when i make the hud at 1600x900 res, its looks nice, but when i change my resoultion to 1920x1080, the hud is looks like blured out.

 

Anybody can help me please with this?

 

here is 1600x900 

 

 

here is at 1920x1080p 

here is the script. (THIS IS ONLY because of testing.

 


--—————————————————————————————————————————————————————————
--—————————————————————————————————————————————————————————

local screenW,screenH = guiGetScreenSize()
function HUD ()
        dxDrawLine((screenW * 0.5994) - 1, (screenH * 0.5456) - 1, (screenW * 0.5994) - 1, screenH * 0.7111, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.7481, (screenH * 0.5456) - 1, (screenW * 0.5994) - 1, (screenH * 0.5456) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.5994) - 1, screenH * 0.7111, screenW * 0.7481, screenH * 0.7111, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.7481, screenH * 0.7111, screenW * 0.7481, (screenH * 0.5456) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.5994, screenH * 0.5456, screenW * 0.1487, screenH * 0.1656, tocolor(0, 0, 0, 100), false)
        dxDrawLine((screenW * 0.5994) - 1, (screenH * 0.5456) - 1, (screenW * 0.5994) - 1, screenH * 0.5733, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.7481, (screenH * 0.5456) - 1, (screenW * 0.5994) - 1, (screenH * 0.5456) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.5994) - 1, screenH * 0.5733, screenW * 0.7481, screenH * 0.5733, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.7481, screenH * 0.5733, screenW * 0.7481, (screenH * 0.5456) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.5994, screenH * 0.5456, screenW * 0.1487, screenH * 0.0278, tocolor(0, 0, 0, 100), false)
        dxDrawText("The time", screenW * 0.5994, screenH * 0.6833, screenW * 0.6581, screenH * 0.7111, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false)
        dxDrawText("The date", screenW * 0.6894, screenH * 0.6833, screenW * 0.7481, screenH * 0.7111, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false)

        
end
addEventHandler("onClientRender",getRootElement(),HUD)

 

Edited by TheMOG

Share this post


Link to post

GUI Editor does stuff like that to me when you use Dx or its not in the place it should be. This was the reason I changed from using Dx as it never came out correct when I outputted the code.

Share this post


Link to post

I think dx always comes correct regarding its position when it comes to using guieditor (while GUI doesn't). Anyway, It may be blurry because 1080/1900 is not close to be equal to 900/1600. (I don't see any blur in the images tho)

Share this post


Link to post

You probably mean the text is blurry, this can be fixed by making a text scaling.Based on screensize you can determine which scale is needed to have the same output

Share this post


Link to post

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
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.