I want to have an effect where I tween a UI frame to uncover text like so;
keep in mind I want the frame to be transparent and still hide or cover up the text is this possible?
I want to have an effect where I tween a UI frame to uncover text like so;
keep in mind I want the frame to be transparent and still hide or cover up the text is this possible?
You could probably place the text in the frame like so
Then enable clip descendants on that frame
Then you can tween and mess with the text in the frame like this
Another option would be using UIGradient
The script move those 2 points.
local UIGradient = script.Parent
local RunService = game:GetService("RunService")
function setGradTrans(grad,v)
local mar = .01
if v<mar then
grad.Transparency = NumberSequence.new(1)
elseif v>1-mar then
grad.Transparency = NumberSequence.new(0)
else
grad.Transparency = NumberSequence.new({
NumberSequenceKeypoint.new(0,0),
NumberSequenceKeypoint.new(v,0),
NumberSequenceKeypoint.new(v+mar,1),
NumberSequenceKeypoint.new(1,1),
})
end
end
function fadeIn()
local t = tick()
local duration = 3
while tick()-t<duration do
local alpha = (tick()-t)/duration
setGradTrans(UIGradient,alpha)
RunService.RenderStepped:Wait()
end
end
function fadeOut()
local t = tick()
local duration = 3
while tick()-t<duration do
local alpha = (tick()-t)/duration
setGradTrans(UIGradient,1-alpha)
RunService.RenderStepped:Wait()
end
end
while true do
fadeIn()
fadeOut()
end
Woah this is very cool I am looking into this I thought gradients had to be manually in photoshop. Okay nevermind I looked it up a bit and I didnt even know they had a UIgradient thing.