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

How do I make a Frame size change? For now I use + UDim2.new(0,2,0,0)

Asked by 7 years ago
Edited 7 years ago

How do I make the size change for every loop?

for n = 0, 100 do
    textbutton.Text = "Loading..."
    frame.Size = loader.Size + UDim2.new(0,2,0,0)
    wait(math.random(0.4,0.5))
end
0
Are you trying to make a loading bar for your game? GuestRealization 102 — 7y
0
Yh. But don't know how to actually make it follow and wait to all assets are loaded. Can't find any tutorials and I think it's too complicated. MineJulRBX 52 — 7y
0
Please upvote if it worked how you wanted it to :) GuestRealization 102 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Here is a script from my game that increases the loading bar by 0.009 every loop. It makes it look like a slow moving loading bar.

p = script.Parent
il = script.Parent.ImageLabel
for i = 1, 100 do 
il.Size = il.Size + UDim2.new(0.009,0,0)
p.Text = "Loading Tumble-Slides "..(i*1).." %"
wait(0.1)
end

Please upvote if it worked how you wanted it to :)

Ad
Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

You can use TweenSize() and TweenPosition() to move a GUI fluidly:

frame:TweenSize(UDim2.new(0.5,0,0.5),Enum.EasingDirection.Out,
Enum.EasingStyle.Sine,0.5,true)

Learn more about TweenSize() and TweenPosition() here.

0
I tried but it doesn't work like I wan't it too. It needed to be + 2 every time it has waited. Also because I use math.random in my script. MineJulRBX 52 — 7y

Answer this question