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: Can someone teach me how to use TweenPosition?

Previous Thread :: Next Thread 
Stonixx is not online. Stonixx
Joined: 05 Jun 2010
Total Posts: 2781
27 Oct 2014 07:16 PM
I've never understood it in writing.
Report Abuse
DracoTrainingMaster is not online. DracoTrainingMaster
Top 100 Poster
Joined: 14 Oct 2006
Total Posts: 524
27 Oct 2014 07:17 PM
What do you not understand?
It's very simple.
Report Abuse
Stonixx is not online. Stonixx
Joined: 05 Jun 2010
Total Posts: 2781
27 Oct 2014 07:18 PM
I don't know...

I guess I wasn't focused when I tried reading it.

I'll read the wiki article and stuff again, an dI'll get back to this thread and be more specific as to what my problem is.
Report Abuse
Stonixx is not online. Stonixx
Joined: 05 Jun 2010
Total Posts: 2781
27 Oct 2014 07:25 PM
Well, I understand this:

GUI:TweenPosition(UDim2.new(1, 0, 1, 0))


However, I don't fully understand "Out", "Quad" and the other EasingDirections... Can you just elaborate on these if you can?
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
27 Oct 2014 07:35 PM
This will explain it all: http://hosted.zeh.com.br/mctween/animationtypes.html
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
27 Oct 2014 07:42 PM
gui:TweenPosition(UDim2.new(0.5,0,0.5,0),"Out","Quad",0.5,true,nil)

"Out tells the GUI to tween from the start position to the end position. 99.9999% of the time, you'll just use Out so don't worry about it.

Quad is a style of interpolation, which is described on the wiki among the other Easing Styles. It basically tells roblox how the gui should be interpolated from its current position to the new position. You can experiment with the types to see how it changes the behavior

The 0.5 determines how long it takes to get from its current position to the new position.

The true is used as a boolean over-ride. Basically if that is true, it won't yield the code while it tweens. So basically these two lines of code should do the same thing:



---------------

Spawn(function ()
gui:TweenPosition(UDim2.new(0.5,0,0.5,0),"Out","Quad",0.5,false)
end)
print("lol")

---------------

gui:TweenPosition(UDim2.new(0.5,0,0.5,0),"Out","Quad",0.5,true)
print("lol")

---------------

the nil is a function which is called when the gui finishes tweening. Its entirely optional, and you don't need to actually put the nil there.
Report Abuse
DracoTrainingMaster is not online. DracoTrainingMaster
Top 100 Poster
Joined: 14 Oct 2006
Total Posts: 524
27 Oct 2014 07:52 PM
eLunate Those are not working.
I remember all those, use to be on the wiki but none of them are working.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
27 Oct 2014 07:56 PM
They work if you use my tween library instead :3
All of them except the elastic tween, which I need to fix the math for.
Report Abuse
DracoTrainingMaster is not online. DracoTrainingMaster
Top 100 Poster
Joined: 14 Oct 2006
Total Posts: 524
27 Oct 2014 07:57 PM
Only one I want to use, lol.
easeOutElastic
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
27 Oct 2014 07:58 PM
Heh me too, which is why I really need to fix the math -.-
Report Abuse
Stonixx is not online. Stonixx
Joined: 05 Jun 2010
Total Posts: 2781
27 Oct 2014 08:04 PM
Thanks CloneTrooper
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