Garry's Mod Wiki

DSlider

Description

Creates a slider that can be moved along the X and/or Y axis

Parent

Derives from DPanel.

Methods

boolean DSlider:GetDragging()
Identical to DSlider:IsEditing
number DSlider:GetLockX()
Returns the draggable panel's lock on the X axis. See DSlider:SetLockX for more info.
number DSlider:GetLockY()
Returns the draggable panel's lock on the Y axis. See DSlider:SetLockY for more info.
number DSlider:GetNotches()
We advise against using this. It may be changed or removed in a future update. Appears to be non functioning, however is still used by panels such as DNumSlider.
any DSlider:GetNumSlider()
We advise against using this. It may be changed or removed in a future update. Does nothing.
number DSlider:GetSlideX()
Returns the target position of the draggable "knob" panel of the slider on the X axis. Set by DSlider:SetSlideX.
number DSlider:GetSlideY()
Returns the target position of the draggable "knob" panel of the slider on the Y axis. Set by DSlider:SetSlideY.
boolean DSlider:GetTrapInside()
We advise against using this. It may be changed or removed in a future update. Appears to be non functioning, however is still used by panels such as DNumSlider.
boolean DSlider:IsEditing()
Returns true if this element is being edited by the player.
DSlider:SetBackground( string path )
Sets the background for the slider.
DSlider:SetDragging( boolean dragging )
This is used internally - although you're able to use it you probably shouldn't. Sets whether or not the slider is being dragged.
DSlider:SetImage()
We advise against using this. It may be changed or removed in a future update. Does nothing.
DSlider:SetImageColor()
We advise against using this. It may be changed or removed in a future update. Does nothing.
DSlider:SetLockX( number lockX = nil )
Sets the lock on the X axis. For example the value 0.5 will lock the draggable panel to half the width of the slider's panel.
DSlider:SetLockY( number lockY = nil )
Sets the lock on the Y axis. For example the value 0.5 will lock the draggable panel to half the height of the slider's panel.
DSlider:SetNotches( number notches )
We advise against using this. It may be changed or removed in a future update. Appears to be non functioning, however is still used by panels such as DNumSlider.
DSlider:SetNumSlider( any slider )
We advise against using this. It may be changed or removed in a future update. Does nothing.
DSlider:SetSlideX( number x )
This is used internally - although you're able to use it you probably shouldn't. Used to position the draggable panel of the slider on the X axis.
DSlider:SetSlideY( number y )
This is used internally - although you're able to use it you probably shouldn't. Used to position the draggable panel of the slider on the Y axis.
DSlider:SetTrapInside( boolean trap )
We advise against using this. It may be changed or removed in a future update. Appears to be non functioning, however is still used by panels such as DNumSlider.
number, number DSlider:TranslateValues( number x, number y )
For override by child panels, such as DNumSlider.

Example

Make a slider at 50, 50 that can move 100 pixels on the X axis.

local frame = vgui.Create( "DFrame" ) frame:SetSize( 500, 300 ) frame:Center() frame:MakePopup() local Slider = vgui.Create( "DSlider", frame ) Slider:SetPos( 50, 50 ) Slider:SetSize( 100, 20 )

Page Links


Special Pages


Wikis

?

Render Time: 32ms

DB GetPage 3
Generate Html 6
SaveChanges (1) 8
Render Body 0
Render Sidebar 12