UI
The UI library serves as a small collection of potentially useful UI related functions.
Functions
TweenColor(Item | Instance, Duration | number, Color | Color3)
Tweens the specified item's ImageColor3 (if an ImageLabel or ImageButton) or BackgroundColor3 over the specified duration to the specified color.
HoverEffect(Item | Instance, Duration | number: 0.5, Color | Color3: Color3.new(1, 1, 1), Lerp | number: 0.15)
Sets up a hover effect for the specified item.
ExtendScrollingFrame(Item | Instance, ScrollingFrame | ScrollingFrame, ScrollToBottom | bool: true, Parent | Instance: nil)
Adds the specified item inside the specified ScrollingFrame and resizes the ScrollingFrame's CanvasSize to fit all its elements. You can optionally make the ScrollingFrame scroll to the bottom when the item is inserted. Note that if no Parent is specified, the item will not be parented to anything during this function.
ButtonState(Button | Instance, Sound | string: nil, State | string: Button.Name, Value | bool: false, Togglable | bool: true, Callback | function: nil)
Creats a state action for the specified button. If a sound is provided, the button will play the specified sound when clicked. Having a callback when clicked is optional.
StateAction(State | string, Item | Instance, Value, Duration | number: 0.5, ...)
Clone of Utility's StateAction function.
UI:StateAction("Tab1", script.Parent.Tab1, true, 0.5, "Position", UDim2.new(0.5, 0, 0.5, 0)) -- Center when Tab1 is true
UI:StateAction("Tab1", script.Parent.Tab1, false, 0.5, "Position", UDim2.new(-1, 0, 0.5, 0)) -- Hide when Tab1 is false