ajout de la lib rndx
This commit is contained in:
@@ -1,18 +1,16 @@
|
||||
local function RX(x) return x * (ScrW() / 1920) end
|
||||
|
||||
local function RY(y) return y * (ScrH() / 1080) end
|
||||
|
||||
function DrawDisc(x, y, iRadius, iProgress, iOffset)
|
||||
|
||||
iX = iX or 0
|
||||
iY = iY or 0
|
||||
iOffset = iOffset or 0
|
||||
iRadius = iRadius or 25
|
||||
iProgress = iProgress or 360
|
||||
|
||||
local tDisc = {
|
||||
{ x = x, y = y }
|
||||
}
|
||||
local tDisc = {
|
||||
{ x = x, y = y }
|
||||
}
|
||||
|
||||
for i = 0, iProgress do
|
||||
local iRad = math.rad(-i + iOffset)
|
||||
@@ -23,7 +21,6 @@ function DrawDisc(x, y, iRadius, iProgress, iOffset)
|
||||
|
||||
draw.NoTexture()
|
||||
surface.DrawPoly(tDisc)
|
||||
|
||||
end
|
||||
|
||||
local function DrawVerticalDisc(x, y, outerR, innerR, progress)
|
||||
@@ -61,12 +58,12 @@ local function DrawVerticalDisc(x, y, outerR, innerR, progress)
|
||||
end
|
||||
|
||||
local materials = {
|
||||
heart = Material("materials/xyoss/hud/heartIcon.png"),
|
||||
hunger = Material("materials/xyoss/hud/hungerIcon.png"),
|
||||
job = Material("materials/xyoss/hud/jobIcon.png"),
|
||||
money = Material("materials/xyoss/hud/moneyIcon.png"),
|
||||
name = Material("materials/xyoss/hud/nameIcon.png"),
|
||||
shield = Material("materials/xyoss/hud/shieldIcon.png"),
|
||||
heart = Material("xyoss/hud/heartIcon.png"),
|
||||
hunger = Material("xyoss/hud/hungerIcon.png"),
|
||||
job = Material("xyoss/hud/jobIcon.png"),
|
||||
money = Material("xyoss/hud/moneyIcon.png"),
|
||||
name = Material("xyoss/hud/nameIcon.png"),
|
||||
shield = Material("xyoss/hud/shieldIcon.png"),
|
||||
}
|
||||
|
||||
local displayMoney = 0
|
||||
@@ -104,8 +101,9 @@ hook.Add("HUDPaint", "bladw_HUD", function()
|
||||
DrawDisc(x + RX(180), y + RY(65), RX(35), 360)
|
||||
|
||||
-- icônes
|
||||
surface.SetDrawColor(255, 255, 255)
|
||||
surface.SetDrawColor(255,255,255,255)
|
||||
surface.SetMaterial(materials.heart)
|
||||
surface.DrawTexturedRect(x - RX(12.5), y + RY(65) - RY(12.5), RX(25), RY(25))
|
||||
surface.DrawTexturedRect(x - RX(12.5), y + RY(50), RX(25), RY(25))
|
||||
surface.SetMaterial(materials.shield)
|
||||
surface.DrawTexturedRect(x + RX(90) - RX(12.5), y + RY(50), RX(25), RY(27))
|
||||
|
||||
Reference in New Issue
Block a user