Terpy v1.3.2
Bug Fixes
- Fixed viewport frames not being supported.
Pretty cool!!!
I will be using this.
Additions
includeDescendantTerpies
when setting and tweening a Terpy’s transparency.Changes (non-breaking)
Bug Fixes
Additions
Terpy:FromInstance()
to retrieve an already made Terpy on an object.Terpy:SetTransparency(0)
.Wow, this is an amazing module. Actually one of those rare modules I could use for my experience out of the box without needing to tweak it’s sources.
Supereasy to use.
Thanks a lot for making and sharing it!
I’m not sure if this is a valid suggestion as I didn’t check all the containers Terpy can run on, but a possible improvement could be to set Visible false/true of the container the Terpy was created for when transparency reaches/leaves 1.
But it was also pretty easy to do that with current implementation. Example:
Time:GetAttributeChangedSignal("Visible"):Connect(function()
-- Wait for existing Tween to complete
if FrameTween and FrameTween.PlaybackState ~= Enum.PlaybackState.Completed then
FrameTween.Completed:Wait()
-- Do a wait() here to allow connected function to run.
task.wait()
end
if Time:GetAttribute("Visible") then
-- Set Frame visible, tween in transparency
Frame.Visible = true
local tweenInfo = TweenInfo.new(0.5)
FrameTween = FrameTerpy:TweenTransparency(tweenInfo, 0)
else
-- Tween out Frame's transparency
local tweenInfo = TweenInfo.new(1)
FrameTween = FrameTerpy:TweenTransparency(tweenInfo, 1)
FrameTween.Completed:Once(function()
-- Set Frame invisible when Tween is completed
Frame.Visible = false
end)
end
end)
Thanks!
As you said, it’s pretty easy to do it. You can simplify your code a little bit though keeping in mind that calling FrameTerpy:TweenTransparency()
cancels the current tween:
Time:GetAttributeChangedSignal("Visible"):Connect(function()
if Time:GetAttribute("Visible") then
-- Set Frame visible, tween in transparency
Frame.Visible = true
FrameTerpy:TweenTransparency(TweenInfo.new(0.5), 0)
else
-- Tween out Frame's transparency
FrameTerpy:TweenTransparency(TweenInfo.new(0.5), 1).Completed:Once(function(playbackState)
if playbackState == Enum.PlaybackState.Completed then
-- Set Frame invisible when Tween is completed
Frame.Visible = false
end
end)
end
end)