Garry's Mod Wiki

Material:SetAlpha

  Material:SetAlpha( number alpha )

Description

Sets the alpha value of the Material panel.

Arguments

1 number alpha
The alpha value, from 0 to 255.

Example

Creates a transparent SWEP icon in the middle of the screen.

local mat = vgui.Create("Material") mat:SetSize(200, 200) mat:Center() mat:SetMaterial("weapons/swep") mat:SetAlpha(128)
Output: