Login to ZARP
|
|
I am in the middle of trying to make a working HUD which shows just armor and health and the current minute but this is what I have got so far.
surface.CreateFont( "Font1", {
font = "Arial", -- Use the font-name which is shown to you by your operatorating system.
size = 100,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true,
underline = false,
italic = false,
strikeout = false,
symbol = false,
rotary = false,
shadow = false,
additive = false,
outline = false,
} )
hook.Add("HUDPaint" , "DrawMyHud" , function()
local Health = LocalPlayer():Health()
local Armor = LocalPlayer():Armor()
draw.RoundedBox(0,1570,970,400,200,Color(80,80,80))
draw.RoundedBox(0,1580,980,400,100,Color(40,40,40))
draw.RoundedBox(0,1600,1000,Health * 3,30,Color(225,120,120))
draw.RoundedBox(0,1600,1040,Armor * 3,30,Color(120,120,225))
end) |
|
Last Edit: 6 years 9 months ago by Nafe.
Login or register to post a reply.
|
One thing to watch out for with HUDs is how they scale on lower resolutions. Put your resolution down to the lowest and it'll take up 80% of your display lol.
Using ScrW() and ScrH() gets you the current screen width and height respectively which you can use as a multiplier to make a good scale for all resolutions. |
|
Login or register to post a reply.
The following user(s) said Thank You: Nafe
|
.uzi wrote:
One thing to watch out for with HUDs is how they scale on lower resolutions. Put your resolution down to the lowest and it'll take up 80% of your display lol. Using ScrW() and ScrH() gets you the current screen width and height respectively which you can use as a multiplier to make a good scale for all resolutions. local function Scale(s, h)
local devw = 1080 --Development width
local devh = 1920 --Development height
return s * (h and (ScrH() / devw) or (ScrW() / devh))
end |
|
Discord: thexnator Former Community Owner: 2020-2022
Login or register to post a reply.
|
TheXnator wrote:
.uzi wrote:
One thing to watch out for with HUDs is how they scale on lower resolutions. Put your resolution down to the lowest and it'll take up 80% of your display lol. Using ScrW() and ScrH() gets you the current screen width and height respectively which you can use as a multiplier to make a good scale for all resolutions. local function Scale(s, h)
local devw = 1080 --Development width
local devh = 1920 --Development height
return s * (h and (ScrH() / devw) or (ScrW() / devh))
end Yeah what nerd over here put |
|
Login or register to post a reply.
|
|
|
Login or register to post a reply.
|
Nafe wrote:
consider usinglerp to make it more smooth, mostly for the sake of using it |
|
ex-minecraft owner, zarp legend (Was there during the infancy of Zarp), ex-ssrp admin, ex-teamspeak emblem (For SSRP admin & minecraft owner)
Login or register to post a reply.
|
|
|
Login or register to post a reply.
|
|