Jump to content

interpolateBetween -- Again


AJXB

Recommended Posts

  
 local px, py = guiGetPosition ( pic,false ) 
local sx,sy = guiGetScreenSize () 
function onRender( ) 
    if state == 'OpenIt' then 
        local nx, ny = interpolateBetween ( px, py,0,px,(py/3)+85,0,getProgress( 3000 ),"OutElastic",0.3, 1.0 ) 
        guiSetPosition( pic, nx, ny, false ) 
    elseif state == 'CloseIt' then 
        local nx, ny = interpolateBetween ( px, py,0,px,(py/3)+475,0,getProgress( 3000 ),"OutElastic",0.3, 1.0 ) 
        guiSetPosition( pic, nx, ny, false ) 
    end 
end 
addEventHandler( 'onClientRender', root, onRender ); 
  

So I've managed to kinda make it move in the way I want, but when I trigger a function that will open the picture and trigger another to close it, it does not animate like it used to, I mean first time I start the resource and trigger openIt, OutElastic works, then I close it, Now the second time I open it, It doesn't animate, what's the issue ? :S

Link to comment

Well, to explain, there are 2 steps, Open, and close, When I open it, all good, close works too, but the animate, the interpolatebetween and the OutElastic aren't working, When I open it for the second time, It only sets the position, Like interpolateBetween doesn't exist.

Link to comment

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...