Terpy (tween large models and guis' overall transparency with ease)

Terpy v1.3.2


Bug Fixes

  • Fixed viewport frames not being supported.

Pretty cool!!!
I will be using this.

1 Like

Terpy v1.3.3


Bug Fixes

  • Fixed canvas groups not being supported.
  • Fixed on descendant removing bug.
1 Like

Terpy v1.4.1


Additions

  • Added boolean includeDescendantTerpies when setting and tweening a Terpy’s transparency.

Changes (non-breaking)

  • Created a seperate child module for the function that gets transparency properties for instances.

Bug Fixes

  • Fixed another on descendant removing bug.

Terpy v1.5.2


Additions

  • Added static method Terpy:FromInstance() to retrieve an already made Terpy on an object.
  • Added errors for creating Terpies which are already influenced by other Terpy objects.
  • Added a screaming warning at the top of the module that instances added to a Terpy which start transparent will stay transparent even when using 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)
1 Like

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)
1 Like