{"id":"stratiz/UISpringSet","name":"UISpringSet","scope":"stratiz","platform":"roblox","description":"Object for animating the visibility a frame and its selected children with springs","version":"1.5.1","latest":"1.5.1","versions":["1.0.0","1.1.0","1.2.0","1.2.1","1.3.0","1.4.0","1.4.1","1.5.0","1.5.1"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{"chiefwildin/Spring":{"version":"^1.14.0"},"stratiz/Cleaner":{"version":"^1.1.0"},"stratiz/Signal":{"version":"^1.0.0"},"stratiz/Transparency":{"version":"^1.2.0"}},"integrity":"95e04dcd488f73295d880cb9dfd8bc5ff35eeb1f27499eb0049fd0283f66b94f","likes":0,"downloads":2222,"install":"forest install stratiz/UISpringSet","url":"https://forest.dev/p/roblox/stratiz/UISpringSet","files":"https://api.forest.dev/ai/package/roblox/stratiz/UISpringSet/files","readme":"# UISpringSet\r\n\r\nAnimates 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.\r\n\r\n## Usage\r\n\r\n```lua\r\nlocal UISpringSet = require(Packages.UISpringSet)\r\n\r\nlocal menu = UISpringSet.new({\r\n    frame.Title,\r\n    { UI = frame.Body, Direction = Vector2.new(1, 0) }\r\n})\r\n\r\nmenu:Show()\r\nmenu:Hide()\r\n\r\nmenu:Destroy()\r\n```\r\n\r\nEach 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.\r\n\r\nThe set only updates on Heartbeat while one of its springs is moving, so a set at rest costs nothing per frame.\r\n\r\n## API\r\n\r\n### UISpringSet.new(objects, options)\r\n\r\nCreates a set from an array of GuiObjects or `{ UI = GuiObject, Direction = Vector2? }` entries.\r\n\r\nPass `{ TrackNewDescendants = true }` to also fade anything added under the objects after the set was made, like list items cloned in later or content mounted a frame late. Each one is learned as it is when added, so add it in its resting state. See Transparency for the details.\r\n\r\n### UISpringSet:Show(noAnimate)\r\n\r\nAnimates every object into view. Pass `true` for `noAnimate` to snap into view instantly.\r\n\r\n### UISpringSet:Hide(noAnimate)\r\n\r\nAnimates every object out of view. Pass `true` for `noAnimate` to snap out of view instantly.\r\n\r\n### UISpringSet:SetTarget(uiObject, target, noAnimate)\r\n\r\nAnimates one object toward its own target, `0` shown and `1` hidden, without changing the set's target. Pass `true` for `noAnimate` to snap it there instantly.\r\n\r\n### UISpringSet:AddUIObject(object)\r\n\r\nAdds a GuiObject or entry table to the set. Returns its transparency object and its spring.\r\n\r\n### UISpringSet:RemoveChild(uiObject)\r\n\r\nRemoves the object from the set and restores its transparency.\r\n\r\n### UISpringSet:SetStartPosition(uiObject, position)\r\n\r\nMoves 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.\r\n\r\n### UISpringSet:SetSpringProps(speed, damper)\r\n\r\nSets the spring speed and damper for the whole set. Later objects run slightly slower so they trail the first one.\r\n\r\n### UISpringSet:GetSpringObject(uiObject)\r\n\r\nReturns the spring driving the given object. Writing to it right after the call works. A spring kept and written to later is not drawn while the set is at rest, use `SetTarget` for that.\r\n\r\n### UISpringSet:GetTransparencyObject(uiObject)\r\n\r\nReturns the transparency object for the given object.\r\n\r\n### UISpringSet:OnSettled(callback)\r\n\r\nCalls the callback whenever the set finishes animating. Fires immediately if the set is already settled. Returns a connection.\r\n\r\n### UISpringSet:Settle()\r\n\r\nSnaps every spring to its target instantly and fires the settled signal.\r\n\r\n### UISpringSet:IsShowing()\r\n\r\nReturns true if the set is currently targeting the shown state.\r\n\r\n### UISpringSet:Destroy()\r\n\r\nStops the update loop.\r\n","readmeTruncated":false}