jknite
|
  |
| Joined: 30 Nov 2007 |
| Total Posts: 614 |
|
|
| 29 Sep 2012 05:09 PM |
I am creating a GUI that is going to expand, then condense. Then bring a text in and out. I need help with the functions though. The current ones I have in (repeat until) wont stop the GUI from expanding. I have tried a for loop but failed. Please assist. If you help fix this issue, I will give you credit unto my game. It's almost finished. (First expanding, other 5-6 movements are repetitive to the first one and would waste your time and your effort)
Logo = script.Parent.Logo Creator = script.Parent.Creator change1 = UDim2.new(0.01, 0, 0.01, 0) change2 = UDim2.new(0.1, 0, 0.1, 0)
Logo.Position = UDim2.new(1, 0, 1, 0) Logo.Size = UDim2.new(0, 0, 0, 0) Creator.Position = UDim2.new(1, 0, 0.5, 0) Creator.TextTransparency = 1 print("GUI set")
Logo.Visible = true Creator.Visible = false
print("Logo in") repeat Logo.Size = Logo.Size + change1 Logo.Position = Logo.Position - change1 wait(0.05) until Logo.Size == UDim2.new(1, 0, 1, 0)and Logo.Position == UDim2.new(0, 0, 0, 0)
print("Waiting 1 second") wait(1)
--Thanks, ---Jknite |
|
|
| Report Abuse |
|
|
eJorge
|
  |
| Joined: 09 Jun 2011 |
| Total Posts: 5966 |
|
|
| 29 Sep 2012 05:12 PM |
I recommend using this instead: http://wiki.roblox.com/index.php/TweenSize_(Method)
It's very useful. There's also TweenPosition and TweenSizeAndPosition.
Read this first if you have never used tweening before: http://wiki.roblox.com/index.php/Tweening |
|
|
| Report Abuse |
|
|
jknite
|
  |
| Joined: 30 Nov 2007 |
| Total Posts: 614 |
|
|
| 29 Sep 2012 05:14 PM |
| Thanks, I was looking into tweening, but I couldn't figure out how to work it easily. First attempt failed for me. |
|
|
| Report Abuse |
|
|
jknite
|
  |
| Joined: 30 Nov 2007 |
| Total Posts: 614 |
|
|
| 29 Sep 2012 05:30 PM |
I am having a problem, my current one doesnt work at all... It skips moving in.
script.Parent:TweenSizeAndPosition(UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 0, 0), "In", "Linear", 6) |
|
|
| Report Abuse |
|
|
jknite
|
  |
| Joined: 30 Nov 2007 |
| Total Posts: 614 |
|
| |
|
crusada91
|
  |
| Joined: 04 Sep 2010 |
| Total Posts: 684 |
|
|
| 29 Sep 2012 06:02 PM |
for i = 1, 200 do size = size + UDim2.new(x, ym z) wait() end |
|
|
| Report Abuse |
|
|
jknite
|
  |
| Joined: 30 Nov 2007 |
| Total Posts: 614 |
|
|
| 29 Sep 2012 06:09 PM |
there are way too many errors in that post... >.>
|
|
|
| Report Abuse |
|
|
eJorge
|
  |
| Joined: 09 Jun 2011 |
| Total Posts: 5966 |
|
|
| 30 Sep 2012 02:31 AM |
| You only need one UDim2 value (the end position). |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2012 02:35 AM |
| @eJorge - No, he was using TweenSizeAndPosition - he needs one for size and one for positi n |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2012 02:41 AM |
script.Parent.Example:TweenSize(UDim2.new(1,0,1,0),"In","Linear",.5,false,nil)
I personally think it runs smoother with a nil on the end... But that could just be me.
-- Live young. Enjoy life. -- |
|
|
| Report Abuse |
|
|