Code |
local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 50,50 )
DermaPanel:SetSize( 200, 250 )
DermaPanel:SetTitle( "Testing Derma Stuff" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()
local Volume=50
local NumSlider = vgui.Create( "DNumSlider", DermaPanel )
NumSlider:SetPos( 25,50 )
NumSlider:SetWide( 100 )
NumSlider:SetText( "Volume" )
NumSlider:SetMin( 0 ) -- Minimum number of the slider
NumSlider:SetMax( 100 ) -- Maximum number of the slider
NumSlider:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
NumSlider.Slider:SetSlideX(Volume/100) -- This value is between 0 and 1. Since volume is 50 and the max slider is 100 it will be halfway.
|