Tweening: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
m
Text replacement - "</code>" to "</SyntaxHighlight>"
>JulienDethurens
m (Text replacement - "</code>" to "</SyntaxHighlight>")
Line 25: Line 25:




It's also important to note that the GUIs position is measured from the top left corner, not the center.  So to make it grow from the center, we have to change the Size, and position, calling for <code>TweenSizeAndPosition</code>
It's also important to note that the GUIs position is measured from the top left corner, not the center.  So to make it grow from the center, we have to change the Size, and position, calling for <code>TweenSizeAndPosition</SyntaxHighlight>


{{Example|<code lua>
{{Example|<code lua>
Line 31: Line 31:
script.Parent.Frame.Size = UDim2.new(0,0,0,0) -- We set the frame size too 0, so it will pop out of the middle of the screen.   
script.Parent.Frame.Size = UDim2.new(0,0,0,0) -- We set the frame size too 0, so it will pop out of the middle of the screen.   
script.Parent.Frame:TweenSizeAndPosition(UDim2.new(0, 400, 0, 600), UDim2.new(.5, -200, .5, 600), "Out", "Quad", 1) -- This will change the size, from 0,0 too 400, 600, and the position will change so the frame stays centered.   
script.Parent.Frame:TweenSizeAndPosition(UDim2.new(0, 400, 0, 600), UDim2.new(.5, -200, .5, 600), "Out", "Quad", 1) -- This will change the size, from 0,0 too 400, 600, and the position will change so the frame stays centered.   
</code>}}
</SyntaxHighlight>}}


== In, Out, Inout ==
== In, Out, Inout ==

Navigation menu