Make your GUIs look nicer (Tweening Tutorial)
Tweening is moving or resizing GUIs in a particular way that makes it look much smoother than generic GUI movement using for loops. You can read from the wiki here.
Tweening allows for you to change the tweening direction, tweening position / size and the time it will take to carry out the action. Firstly I'll explain TweenPosition.
For TweenPosition to work you are going to need to have the GUI object saved as a variable.
The code for TweenPosition is this: ({EXAMPLE} needs replacing by you)
{Your Gui object}:TweenPosition (UDIm2.new({Where you want it to go}), {the direction of tweening}, {The tweening style}, {Time taken (number)} )
Here is an example usage of it:
test:TweenPosition(UDim2.new(-0.5,0,0.25,0),1,7,3)
-- Here test is the GUI object. The UDim2 position represents where you want it to move to. The direction of tweening here is out and the style is Elastic. It should take 3 seconds to execute.
TweenSize uses almost the same method, the code for TweenSize is this: ({EXAMPLE} needs replacing by you)
{Your Gui object}:TweenPosition (UDIm2.new({The size you want it to become}), {the direction of tweening}, {The tweening style}, {Time taken (number)} )
Here is an example of tweening size:
open:TweenSize(UDim2.new(0.1, 0,0.1, 0), 0, 2, 1)
--Here open is the GUI object. The UDIM2 size is the size it will change to, the direction is In, the style is Back and the time taken is 1 second.
If you didn't understand this tutorial or need further guidance, you can use the model below and watch my video tutorial on this. If you still don't understand after checking the wiki, model and video then contact me at the bottom of this page. Make sure to give a real email or I can't reply.
Model:
http://bit.ly/2iAFPtK
Video: