• Hud Resolution Problems
    1 replies, posted
[CODE]local function Base() draw.RoundedBox(20,ScrW() -2000,ScrH() -70,ScrW() -1500,ScrH() -70,Color(110,110,110,250)) draw.RoundedBox(20,ScrW() -300,ScrH() - 70,400,170,Color(110,110,110,250)) --HUD-- draw.RoundedBox(6,-16,ScrH() -60,356 ,25,Color(200,200,200,250)) draw.RoundedBox(6,-16,ScrH() -30,356 ,25,Color(200,200,200,250)) --draw.RoundedBox(6,4,700,ScrW() - 1020 ,18,Color(200,200,200,250)) --draw.RoundedBox(6,4,725,ScrW() - 1020 ,18,Color(200,200,200,250)) --draw.RoundedBox(6,4,750,ScrW() - 1020 ,18,Color(200,200,200,250)) --AMMO HUD-- draw.RoundedBox(6,ScrW() -300,ScrH() -60,400,25,Color(200,200,200,250)) draw.RoundedBox(6,ScrW() -300,ScrH() -30,400,25,Color(200,200,200,250)) local DrawHealth = LocalPlayer():Health() or 0 local EcoHealth = LocalPlayer():Health() or 0 if DrawHealth > 100 then DrawHealth = 100 end if DrawHealth < 0 then DrawHealth = 0 end if DrawHealth != 0 then draw.RoundedBox(6,-16,ScrH() -60,(356) * DrawHealth / 100,25,Color(255,0,0,255)) end local DrawArmor = LocalPlayer():Armor() or 0 local EcoArmor = LocalPlayer():Armor() or 0 if DrawArmor > 100 then DrawArmor = 100 end if DrawArmor < 0 then DrawArmor = 0 end if DrawArmor != 0 then draw.RoundedBox(6,-16,ScrH() -30,(356) * DrawArmor / 100,25,Color(0,0,255,255)) end local client =LocalPlayer() local DrawAmmo1 = client:GetActiveWeapon():Clip1() local EcoAmmo1 = client:GetActiveWeapon():Clip1() // How much ammunition you have inside the current magazine if DrawAmmo1 > 100 then DrawAmmo1 = 100 end if DrawAmmo1 < 0 then DrawAmmo1 = 0 end if DrawAmmo1 != 0 then draw.RoundedBox(6,ScrW() -300,ScrH() -60,(400) * DrawAmmo1 / 40,25,Color(255, 208, 0)) end local client =LocalPlayer() local DrawAmmo2 = client:GetAmmoCount(client:GetActiveWeapon():GetPrimaryAmmoType()) local EcoAmmo2 = client:GetAmmoCount(client:GetActiveWeapon():GetPrimaryAmmoType()) if DrawAmmo2 > 100 then DrawAmmo2 = 100 end if DrawAmmo2 < 0 then DrawAmmo2 = 0 end if DrawAmmo2 != 0 then draw.RoundedBox(6,ScrW() -300,ScrH() -30,(400) * DrawAmmo2 / 40,25,Color(255, 208, 0)) end local mag_left = client:GetActiveWeapon():Clip1() // How much ammunition you have inside the current magazine local mag_extra = client:GetAmmoCount(client:GetActiveWeapon():GetPrimaryAmmoType()) // How much ammunition you have outside the current magazine draw.DrawText("Health:"..EcoHealth,"Trebuchet24",125,ScrH() -60,Color(255,255,255)) draw.DrawText("Armor:"..EcoArmor,"Trebuchet24",126,ScrH() -30,Color(255,255,255)) --draw.DrawText("Name: "..LocalPlayer():Nick(),"Trebuchet24",6,697,Color(255,255,255)) --draw.DrawText("Salary: $"..LocalPlayer():getDarkRPVar( "salary" ),"Trebuchet24",230,722,Color(255,255,255)) --draw.DrawText("Occupation: "..LocalPlayer():getDarkRPVar( "job" ),"Trebuchet24",7,722,Color(255,255,255)) --draw.DrawText("Money: $"..LocalPlayer():getDarkRPVar( "money" ),"Trebuchet24",7,747,Color(255,255,255)) draw.DrawText("Ammunition Left: "..EcoAmmo1,"Trebuchet24",ScrW() -230,ScrH() -60,Color(255,255,255)) draw.DrawText("Ammunition Extra: "..EcoAmmo2,"Trebuchet24",ScrW() -230,ScrH() -30,Color(255,255,255)) end[/CODE] Please can someone tell me whats wrong with this I am trying to make a hud but it wont work with all resolutions. Thanks.
Avoid using stactic values for your HUD, use /2 or *2 and base off ScrW() and ScrH(), if you are going to use stactic values make sure they take into account the users screen size to scale properly
Sorry, you need to Log In to post a reply to this thread.