DNumberScratch
Description
Choose a number from a number line, with zooming for precision. Zoom in by moving your mouse forward and moving back does the opposite. Looks like a blue circle until you click and hold on it
Parent
Derives methods, etc not listed on this page from DImageButton.
Events
DNumberScratch:OnValueChanged( number newValue )
Called when the value of the DNumberScratch is changed.
Methods
DNumberScratch:DrawNotches( number level, number x, number y, number w, number h, number range, number value, number min, number max )
This is used internally - although you're able to use it you probably shouldn't.
Used by DNumberScratch:DrawScreen.
This is used internally - although you're able to use it you probably shouldn't.
Used by DNumberScratch:PaintScratchWindow.
Returns whether this panel is active or not, i. e. if the player is currently changing its value.
number DNumberScratch:GetDecimals()
Returns the desired amount of numbers after the decimal point.
number DNumberScratch:GetFloatValue()
Returns the real value of the DNumberScratch as a number.
See also DNumberScratch:GetTextValue and DNumberScratch:GetFraction.
number DNumberScratch:GetFraction()
Returns the value of the DNumberScratch as a fraction, a value between 0 and 1 where 0 is the minimum and 1 is the maximum value of the DNumberScratch.
See also:
DNumberScratch:GetTextValue
DNumberScratch:GetFloatValue
DNumberScratch:SetFraction
Returns the range of the DNumberScratch. Basically max value - min value.
boolean DNumberScratch:GetShouldDrawScreen()
Returns whether the scratch window should be visible or not.
string DNumberScratch:GetTextValue()
Returns the real value of the DNumberScratch as a string.
See also DNumberScratch:GetFloatValue and DNumberScratch:GetFraction.
Returns the ideal zoom level for the panel based on the DNumberScratch:GetRange.
Returns whether the player is currently editing the value of the DNumberScratch.
DNumberScratch:LockCursor()
This is used internally - although you're able to use it you probably shouldn't.
Used to lock the cursor in place.
DNumberScratch:PaintScratchWindow()
This is used internally - although you're able to use it you probably shouldn't.
Used to paint the 'scratch' window.
This is used internally - although you're able to use it you probably shouldn't.
Sets whether or not the panel is 'active'.
Forcing this panel to be active may not work.
DNumberScratch:SetDecimals( number decimals )
Sets the desired amount of numbers after the decimal point.
DNumberScratch:SetFloatValue( number val )
This is used internally - although you're able to use it you probably shouldn't.
Does not trigger DNumberScratch:OnValueChanged
Use DNumberScratch:SetValue instead.
DNumberScratch:SetFraction( number frac )
Sets the value of the DNumberScratch as a fraction, a value between 0 and 1 where 0 is the minimum and 1 is the maximum value of the DNumberScratch
Sets the minimum value that can be selected on the number scratch.
DNumberScratch:SetShouldDrawScreen( boolean shouldDraw )
This is used internally - although you're able to use it you probably shouldn't.
Sets if the scratch window should be drawn or not. Cannot be used to force it to draw, only to hide it, which will not stop the panel from working with invisible window.
Sets the value of the DNumberScratch and triggers DNumberScratch:OnValueChanged
DNumberScratch:UpdateConVar()
This is used internally - although you're able to use it you probably shouldn't.
Forces the assigned ConVar to be updated to the value of this DNumberScratch
Example
Create the Number Scratch with the minimum number being 0 and the max being 20
Output: