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

TweenSize

Smoothly resizes a GUI to a new DataType/UDim2 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/TweenPosition, tweens a GUI’s position
  • GuiObject/TweenSizeAndPosition, tweens a GUI’s size and position synchronously

Parameters

Name Type Default Description

The size that the GUI should resize

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 the tween will override an in-progress tween

nil

A callback function to execute when the tween completes

Returns

Return Type Summary

Whether the tween will play


Code Samples


Tween a GuiObject's Size

This code sample demonstrates the usage of the GuiObject/TweenSize function. It initiates an animation on the parent’s GuiObject/Size property to UDim2.new(0.5, 0, 0.5, 0), which is half the GuiObject's parent size on both axes.

Additionally, it demonstrates how the callback parameter can be used to detect when the tween stops (whether it was cancelled by another tween or completed).