Garry's Mod Wiki

Revision Difference

Material:SetAlpha#553604

<function name="SetAlpha" parent="Material" type="panelfunc"> <ispanel>yes</ispanel>⤶ <description>Sets the alpha value of the Material panel.</description> <realm>Client</realm> <args> <arg name="alpha" type="number">The alpha value, from 0 to 255.</arg> </args> </function> <example> <description>Creates a transparent SWEP icon in the middle of the screen.</description> <code> local mat = vgui.Create("Material") mat:SetSize(200, 200) mat:Center() mat:SetMaterial("weapons/swep") mat:SetAlpha(128) </code> <output><image src="Material_SetAlpha_example1.jpg"/></output> </example>