Answered by
8 years ago Edited 8 years ago
Tweening a gui is just a way to make your gui slide or change size smooth and easily. They can either be changed by TweenPosition, TweenSize, or both with TweenSizeAndPosition
With tweening, you don't need to use a for loop, or a while true do loop. The Parameters that you put in basically sets up the loop for you.
Now TweenPosition needs 6 Parameters, the first argument is required. The Parameters are
07 | Defaults to: Enum.EasingDirection.Out |
11 | Defaults to: Enum.EasingStyle.Quad |
22 | Type: function (TweenStatus) |
(from the wiki)
So for example, this would look like
1 | Gui:TweenPosition(UDim 2. new( 0 , 14 , 0 , 14 ), "Out" , "Quad" , 1 , false , nil ) |
From my personal use, TweenPosition is the one you will be using the most. But for everyone that is different.
TweenSize allows you to change the size of the gui. TweenSize has the same Parameters as TweenPosition
For example, it would look like
1 | Gui:TweenSize(UDim 2. new( 0 , 14 , 0 , 14 ), "Out" , "Quad" , 1 , false , nil ) |
Now TweenSizeAndPosition does both of them at the same time.
The only change in Parameters is that they require both endposition and end size
so it would look like
1 | Gui:TweenSizeAndPosition(UDim 2. new( 0 , 15 , 0 , 15 ), UDim 2. new( 1 , 0 , 1 , 0 ), "Out" , "Quad" , 1 , false , nil ) |
Basically all.
Here is a link to the wiki that I used (because im a scrub and forgot)
link
this might be a little overboard. the fix to your script is
1 | script.Parent.GradientDownwards:TweenPosition(UDim 2. new( 0 , . 025 , 0 , 0 )) |
2 | script.Parent.GradientUpwards:TweenPosition(UDim 2. new( 0 , . 025 , 0 , 0 )) |