Garry's Mod Wiki

Revision Difference

DAlphaBar#527002

<panel> <name>DAlphaBar</name> <parent>DPanel</parent> <description>A bar that you can get the Alpha of what you slide the bar to.</description> <description>A bar to select the opacity (alpha level) of a color.</description> </panel> <example> <description>Creates a DAlphaBar and sets its value to 25%.</description> <code> local DAlphaBar = vgui.Create( "DAlphaBar", Parent) local DAlphaBar = vgui.Create( "DAlphaBar" ) DAlphaBar:SetPos( 20, 30 ) DAlphaBar:SetSize( 25, 125 ) DAlphaBar:SetValue( 0 ) DAlphaBar.OnChange = function( self ) print( "DAlphaBar value changed to ".. self:GetValue() ) DAlphaBar:SetValue( 0.25 ) DAlphaBar.OnChange = function( self, newvalue ) print( "DAlphaBar value changed to " .. newvalue ) end </code> </example>