Hi guys,
Currently the gradient of DNumSlider is black.
How to change this color please?
Thx for advance.
Cordially,
Hi guys,
I found solution.
[CODE]
local function PaintNotches(x, y, w, h, num)
if not num then return end
local space = w / num
for i=0, num do
surface.DrawRect(x + i * space, y + 4, 1, 5)
end
end
local DNumSlider = vgui.Create("DNumSlider")
DNumSlider:SetPos(50, 50)
DNumSlider:SetSize(200, 20)
DNumSlider:SetMin(0)
DNumSlider:SetMax(10)
DNumSlider.Slider.Paint = function(self, w, h)
surface.SetDrawColor(Color(255, 255, 255, 100)) -- Color slider gradient
surface.DrawRect(8, h / 2 - 1, w - 15, 1)
PaintNotches(8, h / 2 - 1, w - 16, 1, self.m_iNotches)
end
[/CODE]
Sorry, you need to Log In to post a reply to this thread.