Basically what I want to make is a something where a filled ImageLabel tweens into full size to fill a different one. I will show what I mean below. I already have the cooldown in place, I have just been racking my brain on how to tackle this. I want to make sure that it doesn’t look bad.
That is the full image. I want it to size up to the transparent image below.
How would I do this? Any help appreciated.
Side note: I want to make sure that you can only see the full image label filling up in the transparent one. This is pretty similar to a loading screen such as Bubble Gum Simulator, but it isn’t the same concept because its not black over the image, its the image going up into the transparent one, if that makes sense.
4PackAbs is getting there, what you want to do to achieve a similar (but not perfect effect) easily is enable the ClipsDescendants property of the transparent image then make use of ImageRectOffset and ImageRectSize to make progressively more of the colored image appear.
You’ll have to play around to find out what values of size and offset work here. This should achieve a pretty nice (and very similar) effect if tweened.
local TweenService = game:GetService("TweenService")
local TweenImage = {}
TweenImage.__index = TweenImage
function TweenImage.new(imageLabel)
local self = setmetatable({}, TweenImage)
self.imageLabel = imageLabel
return self
end
function TweenImage:StartTween(duration)
local tweenInfo = TweenInfo.new(
duration, -- Duration of the tween in seconds
Enum.EasingStyle.Linear, -- Easing style
Enum.EasingDirection.InOut -- Easing direction
)
local endSize = Vector2.new(0, self.imageLabel.AbsoluteSize.Y)
local tween = TweenService:Create(self.imageLabel, tweenInfo, {Size = endSize})
tween:Play()
end
return TweenImage
Example usage:
TweenImage.new(script.Parent.ImageLabel)
tweenImage:StartTween(1) -- Pass the desired duration of the tween in seconds