DProgress coloring help pless


Code removed

Does any 1 got any clue how color the background and the exp bar?
I have try myself but cant figure it out.

You’ll need to use custom derma skin for easy method.

Basically you need to use skins for that. You can overwrite small portions of a default-skin to change only what you want to change.

So for example, if you comment out the self.tex.ProgressBar.Back line, it only prints the green center.
You could draw your own rounded rectangle boxes, or textured-rectangle with a gradient and apply color overlay.

Here’s to getting you started :slight_smile:
[lua]local _skin = { };
function _skin:PaintProgress( panel, w, h )

-- self.tex.ProgressBar.Back( 0, 0, w, h );
self.tex.ProgressBar.Front( 0, 0, w * panel:GetFraction(), h );

end
derma.DefineSkin( “MyProgressBarSkin”, “Simple Skin”, _skin );

local _progress = vgui.Create( “DProgress” );
_progress:SetSize( 240, 20 );
_progress:Center( );
_progress:SetFraction( 0.5 );
_progress:SetSkin( “MyProgressBarSkin” );[/lua]

As for the exact color within, look at the default skin located in garrysmod/lua/skins/default.lua or view it here: https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/default_skin.lua

to see exactly what can be modified for other vgui elements. I’m not sure which color is used in the file, so you may end up needing to rewrite the paint function with your own system.

[editline]10th March 2014[/editline]

ninja’d, in terms of the basic idea.

Ty u