Jump to content

GUI Animations


Recommended Posts

Posted

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!

Posted

Right, I used the example from the wiki just for testing purposes, but what I am attempting to achieve is to, do this.

image.png

The gui will come up, showing only the title bar.

image.png

Then ease down unrolling showing the whole window.

image.png

This is how it should look afterwards, then when closing it would just scroll back up.

Posted (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 by Guest
Posted
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. : )

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...