I recently came back to a little UI experiment I was trying to do with an ImageLabel which uses a UIGradient to give the illusion that it continues on forever
this is an old rendition of the UI, but take note of the rhombus pattern in the back
my goal was to make this ImageLabel and this UIGradient, which uses a color sequence to make this disappearing gradient, and dynamically update it to shift around the ImageLabel, giving it a pulsing effect.
I made a *rough* depiction of what the end result is supposed to look like
The reason I initially gave up on this because I couldn’t find any helpful Classes that can manipulate color sequences, and the only way I can think of doing so, is to manually clone pre-made gradients, and you can probably see the redundancy in this approach.
In short, are there any ways to make change color sequences dynamically update in the example shown? (Just a reference to documentation would be great!)
2 Likes
Ok, I looked a little further into it, and managed to create my own number sequences, however it seems TweenService just doesn’t support this datatype, is there any other option to dynamically shift points in a NumberSequence around?
Here’s what I tried
--services
TS = game:GetService("TweenService")
--vars
pulse = script.Parent:WaitForChild("Pulse")
animateInfo1 = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, -1, true, 0)
pulseSequence = NumberSequence.new{
NumberSequenceKeypoint.new(0, 0),
NumberSequenceKeypoint.new(0.59, 0.5),
NumberSequenceKeypoint.new(0.84, 1),
NumberSequenceKeypoint.new(0.99, 0.5),
NumberSequenceKeypoint.new(1, 0)
}
--setup tween, plays tween
function setupTween()
pulseTween1 = TS:Create(pulse, animateInfo1, {Transparency = pulseSequence})
pulseTween1:Play()
end
setupTween()
Since the transparency on Pulse is a different sequence, I assumed it would’ve updated the right points since they have the exact same number of them.
2 Likes