DProgressBar

Hello, i have started working with DProgressBar and i was wondering if it is possible to change the Color of the DProgressBar (The Fraction)

You’d need to override the paint hook, since there is no sub-panel for the actual bar. Take a look at the default skin file to see how it’s done. Something like this should work:

function DProgressBar:Paint(w, h)
    draw.RoundedBox(4, 0, 0, w, h, Color(236,240,241)) --Background
    draw.RoundedBox(4, 0, 0, w * self:GetFraction(), h, Color(231,76,60)) --Red bar
end

Use that as a general idea. (aka localize the colors instead of creating them each paint)

2 Likes