TrapLord Studios™ Posted December 17, 2014 Share Posted December 17, 2014 Hey everyone, I'd like to know whats the best way to look at GUI Animations, and the best way to apply them to GUI, like for instance I'd like to create a simple GUI window/GUI Image that, Spawns as a line in the center of the screen then expand/roll down opening it self, like a scroll, then go back up upon closing. Thanks in advance! Link to comment
Anubhav Posted December 17, 2014 Share Posted December 17, 2014 The best option would be: interpolateBetween Link to comment
TrapLord Studios™ Posted December 17, 2014 Author Share Posted December 17, 2014 Right, I used the example from the wiki just for testing purposes, but what I am attempting to achieve is to, do this. The gui will come up, showing only the title bar. Then ease down unrolling showing the whole window. This is how it should look afterwards, then when closing it would just scroll back up. Link to comment
Saml1er Posted December 17, 2014 Share Posted December 17, 2014 (edited) You can do that without interpolate functions. Basic mathematical knowledge required. ; D local h, stopAnimAt = 0.5, 0 -- let's say we want maximum height 0.5 and stop animation at 0 local move, win = 0, guiCreateWindow (0.4, 0.4,0.7,h, "test window", true) -- relative sizes addEventHandler("onClientRender",root, function ( ) if h <= stopAnimAt then --[[ h = stopAnimAt local wid, _ = guiGetSize ( win , true ) guiSetSize ( win, wid, h, true )]] -- if window does not fully scroll up then remove brackets and use this else h = h - 0.01 -- subtracting will scroll the window up local wid, _ = guiGetSize ( win , true ) guiSetSize ( win, wid, h, true ) end end ) Edited December 17, 2014 by Guest Link to comment
Castillo Posted December 17, 2014 Share Posted December 17, 2014 You got a extra dot at line 14. And I believe you made a typo when you put guiSetPosition instead of guiSetSize? Link to comment
Saml1er Posted December 17, 2014 Share Posted December 17, 2014 You got a extra dot at line 14.And I believe you made a typo when you put guiSetPosition instead of guiSetSize? Oh sorry. I was on my mobile phone, I forgot to edit those functions. Fixed, thank you. : ) Link to comment
TrapLord Studios™ Posted December 18, 2014 Author Share Posted December 18, 2014 Right thanks, but this just spawns the GUI then scrolls it up.. I want it to spawn scroll down, stay for like 20 Seconds, then scroll back up then delete. (Destroy Element) Link to comment
Castillo Posted December 18, 2014 Share Posted December 18, 2014 Well, that was just an example, I'm sure you can make it scroll down, the same way it scrolls up. Link to comment
TrapLord Studios™ Posted December 18, 2014 Author Share Posted December 18, 2014 I got it thanks,. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now