Garry's Mod Wiki

Revision Difference

DAlphaBar#526889

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