generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: TweenPosition

Previous Thread :: Next Thread 
alij12 is not online. alij12
Joined: 03 Oct 2011
Total Posts: 1204
24 Jul 2014 01:19 PM
Is there a way to know if the GUI has finished tweening the position?
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
24 Jul 2014 01:21 PM
You could check if the gui's position is about (because it's not perfectly transition) the end position of the tween.
You could also just use wait (timeyouselectedtomakethetransitition)

-I just hit 4k posts, made a lengthy speech lol: http://www.roblox.com/Forum/ShowPost.aspx?PostID=141338105-
Report Abuse
alij12 is not online. alij12
Joined: 03 Oct 2011
Total Posts: 1204
24 Jul 2014 01:23 PM
Alright thanks, Ill just use wait() since Im using a bounce style
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Jul 2014 01:24 PM
Usually 1 second by default, but if you put a custom time argument just wait that time.
Report Abuse
GollyGreg is not online. GollyGreg
Joined: 22 May 2008
Total Posts: 21835
24 Jul 2014 01:27 PM
The final argument is a callback function.

So for example:

Frame:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Out", "Linear", 0.125, true,
function()
print("The tweening is done") --or a boolean if you prefer or just continue the rest of the thread here
end)
Report Abuse
alij12 is not online. alij12
Joined: 03 Oct 2011
Total Posts: 1204
24 Jul 2014 01:29 PM
Yea, I got it, I had a variable for the time interval, so I just used that. But I have another problem, IF you call the function while its still in use, the GUI gets stuck there, I tried a way around, heres my script:

function notify(txt,who,style,interval,interval2)
plr = game.Players:FindFirstChild(who)
print("Starting...")
if plr~=nil then
print("Player found!")
gui = plr.PlayerGui:findFirstChild("Notify")
if gui~=nil then
print("Gui found!")
iu = gui.Main.InUse
if iu.Value == false then
print("Not in use!")
iu.Value = true
gui.Main.Button.Text = txt.."!"
gui.Main:TweenPosition(UDim2.new(0.25,0,0.3,0),"Out",style,interval,false)
wait(interval2)
gui.Main:TweenPosition(UDim2.new(0.25,0,-0.3,0),"In",style,interval,false)
wait(interval)
iu.Value = false
elseif iu.Value == true then
print("In use, waiting..")
repeat
wait(1)
until
iu.Value == false
iu.Value = true
gui.Main.Button.Text = txt.."!"
gui.Main:TweenPosition(UDim2.new(0.25,0,0.3,0),"Out",style,interval,false)
wait(interval2)
gui.Main:TweenPosition(UDim2.new(0.25,0,-0.3,0),"In",style,interval,false)
wait(interval)
iu.Value = false
end
print("Done!")
end
end
end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Jul 2014 01:49 PM
How is the callback handled if the override is true?
Report Abuse
GollyGreg is not online. GollyGreg
Joined: 22 May 2008
Total Posts: 21835
24 Jul 2014 01:51 PM
cntkillme

I dont think it runs the function if its interrupted. Can't remember.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Jul 2014 02:07 PM
Hopefully it doesn't, or at least the first upvalue of the callback function would be whether it finished or not.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image