Re-Design DNumSlider

Is there a way to re-design the dnumslider to look differently from the default look?

I don’t know anything about Derma Skins, but you can always Paint each individual element of it.
Take a look at the Garry’s mod Lua GitHub. Search for dnumslider or whatever and take a look at the source code. You will (hopefully) find variables you can paint or manipulate.

Depending on what part you want to paint, the PANEL:Init() function got various parts(text entry, slider label & scratch[?]).

self.TextArea = self:Add( "DTextEntry" )
self.Slider = self:Add( "DSlider", self )
self.Label = vgui.Create ( "DLabel", self )
self.Scratch = self.Label:Add( "DNumberScratch" )

So you basically, if you want to paint the slider as example, get the slider by using:

function DNumSlider.Slider:Paint(w, h)

And paint it. For how to paint it, look inside the specific files in the /lua/vgui/ files which are:

  • dnumslider.lua - The whole element itself
  • dnumberscratch.lua - Scratch(?)
  • dslider.lua - The slider
  • dtextentry.lua - The text entry for the number
  • dlabel.lua - The label

I hope that helps! c:

Except that I tried to repaint the notches and it didn’t work and my thread never got a reply so I closed it, so good luck

I think thats a bit too complicated for him, he should try it slow first :stuck_out_tongue: