DNumSlider.ValueChanged

From GMod Wiki

Jump to: navigation, search
Function
Syntax Panel:ValueChanged( Panel, NumberChange )
Where is this used?
Description:
Called every time DNumSlider changes values.
Returns: Panel Number
In Object: Panel
Part of Library: DNumSlider
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DNumSlider.ValueChanged]DNumSlider.ValueChanged [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionCreates a menu slider.
Used onNewerClient.png
Code
 
local DermaPanel = vgui.Create( "DFrame" )
local NumSlider = vgui.Create( "DNumSlider", DermaPanel )
NumSlider:SetPos( 25,50 )
NumSlider:SetWide( 150 )
NumSlider:SetText( "Max Props" )
NumSlider:SetMin( 0 ) -- Minimum number of the slider
NumSlider:SetMax( 256 ) -- Maximum number of the slider
NumSlider:SetDecimals( 0 ) -- Sets a decimal. Zero means it's a whole number
NumSlider:SetConVar( "sbox_maxprops" ) -- Set the convar
NumSlider.ValueChanged = function(pSelf, fValue)
     print("Max prop changed to: "..fValue)
end
 
OutputSelf Panel, Panel Value
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox