Forest Logo
search
package_2

UISpringSet

By @stratizverified

Roblox

UISpringSet

Animates the visibility of one or more GuiObjects with springs. Each object slides in from a direction and fades at the same time, and the whole set can be shown or hidden as a group.

Usage

local UISpringSet = require(Packages.UISpringSet)

local menu = UISpringSet.new({
    frame.Title,
    { UI = frame.Body, Direction = Vector2.new(1, 0) }
})

menu:Show()
menu:Hide()

menu:Destroy()

Each entry is either a GuiObject or a table with a UI field and an optional Direction. Direction is the slide offset per axis, scaled by the object's absolute size, and defaults to Vector2.new(0, 1) which slides up into place from below. Objects start hidden.

API

UISpringSet.new(objects)

Creates a set from an array of GuiObjects or { UI = GuiObject, Direction = Vector2? } entries.

UISpringSet:Show(noAnimate)

Animates every object into view. Pass true for noAnimate to snap into view instantly.

UISpringSet:Hide(noAnimate)

Animates every object out of view. Pass true for noAnimate to snap out of view instantly.

UISpringSet:AddUIObject(object)

Adds a GuiObject or entry table to the set. Returns its transparency object and its spring.

UISpringSet:RemoveChild(uiObject)

Removes the object from the set and restores its transparency.

UISpringSet:SetStartPosition(uiObject, position)

Moves the object's resting position; the set animates relative to it. Use this instead of writing Position directly on a managed object. The set snapshots Position when the object is added and overwrites it while animating, so direct writes get discarded. Applies immediately, even while the set is settled.

UISpringSet:SetSpringProps(speed, damper)

Sets the spring speed and damper for the whole set. Later objects run slightly slower so they trail the first one.

UISpringSet:GetSpringObject(uiObject)

Returns the spring driving the given object.

UISpringSet:GetTransparencyObject(uiObject)

Returns the transparency object for the given object.

UISpringSet:OnSettled(callback)

Calls the callback whenever the set finishes animating. Fires immediately if the set is already settled. Returns a connection.

UISpringSet:Settle()

Snaps every spring to its target instantly and fires the settled signal.

UISpringSet:IsShowing()

Returns true if the set is currently targeting the shown state.

UISpringSet:Destroy()

Stops the update loop.

Package Details

Install command (Click to copy)


Version

1.3.0

License

MIT

check_circle

Safe for commercial use

Automated license review — not legal advice.