Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

[Solved] What is a Tween? [closed]

Asked by 10 years ago

I am not that clear on what these values mean.

They are all numbers but I don't really know what they do. Can you explain what they mean by looking at these variables? --The reason why I have variables is this is how I can learn on what the numbers mean.

local a = ? --Comment here
local b = ? --Comment here
local c = ? --Comment here
local d = ? --Comment here
local e = ? --Comment here

Frame:TweenSize(UDim2.new(a, b, c, d), "Out", "Quad", e, false, nil)

I don't understand Gui tweening that well and I need a basic explanation on how things work in a tween.

Thankyou.

Locked by TheMyrco

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

2 answers

Log in to vote
1
Answered by 10 years ago

Tweening is smooth movement and resizing of Gui's. Tweening in roblox is basically a way to beautify your GUIs, and create a more pleasing graphical appearance. Tweening can be used to resize GUIs, move GUIs, or both.

Scripting the Gui to tween your you need to use either "TweenSize" or "TweenPosition" - That is the obvious part.

Frame:TweenSize
Frame:TweenPosition

The next part is WHERE you want it to END!!

(UDim2.new(0.5, 0, 0.5, 0)

So the code will look like this.

Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0))

BUT the script needs to know WHICH way it will travel. Usually you use "In" or "Out" but you can use "InOut"

So the script will look like this

Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "In",)

BUTTT the script will also need to know what STYLE you want it to move in. (Normal paced to fast at the end) and stuff like that. there are lots of different ones you can use but my favourite are "Bounce" and "Quad"

The script will look like this

Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "In",  "Quad")

The script needs to know how LONG it will travel.

Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "In",  "Quad", "10") -- 10 is the time spent changing in seconds

Last this is not extreemly important. Leave it as false or true.

Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "In",  "Quad", "10", "False") 

I hope I helped out :) Thumbs my upppp :D

0
This helped me a lot! Thank you so much!!!!!!!!!!!! IntellectualBeing 430 — 10y
2
'Tis Ok. I enjoyed writing it. :D ConnorVIII 448 — 10y
0
Wait so I can add multiple lines to do one tween session? IntellectualBeing 430 — 10y
2
I am not sure but this -- Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "In", "Quad", "10", "False") -- was the final product. ConnorVIII 448 — 10y
View all comments (5 more)
0
Oh okay. :) IntellectualBeing 430 — 10y
1
While it is possible to use a string for the time, it is best to use an integer. I recommend removing the quotes from 10. You should also mention that it is ten seconds. Aethex 256 — 10y
0
Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "In", "Quad", 10, "False") --Like this? IntellectualBeing 430 — 10y
2
yus exactly :) ConnorVIII 448 — 10y
0
One important question, Where it says true or false, would I need to trigger that to true when its time for it to tween or do I leave it both true? For close an opening. IntellectualBeing 430 — 10y
Ad
Log in to vote
3
Answered by 10 years ago

A tween is just a smooth transition. The first argument to TweenSize is a UDim2 value, which is the size you want to tween to.

In case you don't know what a UDim2 value is, here's a simple definition: It's a value which is used in ROBLOX to define GUI properties. If we take the following example: UDim2.new(a, b, c, d), then:

  • a is X Scale
  • b is X Offset
  • c is Y Scale
  • d is Y Offset

Scale is percentage of the parent (or screen if no hierarchical superior GuiObject) (0 through 1, meaning you use decimals) and Offset is pixels.

1
This also helped me a lot too! Now I know what the X and Y values are. :) IntellectualBeing 430 — 10y