PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

TweenSizeAndPosition

Smoothly resizes and moves a GUI to a new DataType/UDim2 size and position in the specified time using the specified Enum/EasingDirection|EasingDirection and Enum/EasingStyle|EasingStyle.

This function will return whether the tween will play. Normally this will always return true, but it will return false if another tween is active and override is set to false.

See also

  • GuiObject/TweenSize, tweens a GUI’s size
  • GuiObject/TweenPosition, tweens a GUI’s position

Parameters

Name Type Default Description

The size that the GUI should resize

Where the GUI should move to

Out

The direction in which to ease the GUI to the endPosition

Quad

The style in which to ease the GUI to the endPosition

1

How long, in seconds, the tween should take to complete

false

Whether another tween play, cancelling this tween, before the GUI reaches the endPosition

nil

A callback function to execute when the tween completes

Returns

Return Type Summary

Whether the tween will play


Code Samples


Tween a GUI's Size and Position

The below example would tween a /Frame to the top left of the parent’s size and resize it down to 0.

local frame = script.Parent.Frame
frame:TweenSizeAndPosition(UDim2.new(0,0,0,0), UDim2.new(0,0,0,0))