Description
A bar to select the opacity (alpha level) of a color.
Parent
Derives methods, etc not listed on this page from DPanel.
Events
DAlphaBar:
OnChange(
number alpha )
Called when user changes the desired alpha value with the control.
Methods
table DAlphaBar:
GetBarColor()
Returns the base color of the alpha bar. This is the color for which the alpha channel is being modified.
DAlphaBar:
SetBarColor(
table clr )
Sets the base color of the alpha bar. This is the color for which the alpha channel is being modified.
DAlphaBar:
SetValue(
number alpha )
Sets the alpha value or the alpha bar.
Example
Creates a DAlphaBar and sets its value to 25%.
local DAlphaBar
= vgui.
Create(
"DAlphaBar" )
DAlphaBar:
SetPos( 20, 30 )
DAlphaBar:
SetSize( 25, 125 )
DAlphaBar:
SetValue( 0.25 )
DAlphaBar.
OnChange = function( self, newvalue )
print(
"DAlphaBar value changed to " .. newvalue )
end