PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

ImageTransparency

ImageLabel

float

ImageTransparency determines the alpha of a UI element’s rendered image. A value of 0 is completely opaque, and a value of 1 is completely transparent (invisible). This property behaves similarly to GuiObject/BackgroundTransparency or BasePart/Transparency.


Code Samples


Oscillate ImageTransparency

This code sample oscillates the ImageTransparency of an ImageLabel/ImageButton from 0 to 1 using a sine wave.

local imageLabel = script.Parent

local RunService = game:GetService("RunService")

local function onRenderStep()
	-- Oscillate ImageTransparency from 0 to 1 using a sine wave
	imageLabel.ImageTransparency = math.sin(workspace.DistributedGameTime*math.pi)*.5+.5
end
RunService.RenderStepped:Connect(onRenderStep)