Jump to content

interpolateBetween -- Again


AJXB

Recommended Posts

Posted
  
 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

~ This has to be the worst board post I have ever read. It simply makes no sense. You start off by talking about space or something, then you randomly start babbling about cupcakes, and you end off with random fish names.

~ Don't listen to this guy, any board with the categories 'dinosaurs, spaceships, fried foods, wild animals, alien abductions, business casual, robots, and fireworks' has true potential.

 

Posted

It is, outside of this code, I put "state = 'CloseIt'"

~ This has to be the worst board post I have ever read. It simply makes no sense. You start off by talking about space or something, then you randomly start babbling about cupcakes, and you end off with random fish names.

~ Don't listen to this guy, any board with the categories 'dinosaurs, spaceships, fried foods, wild animals, alien abductions, business casual, robots, and fireworks' has true potential.

 

Posted

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.

~ This has to be the worst board post I have ever read. It simply makes no sense. You start off by talking about space or something, then you randomly start babbling about cupcakes, and you end off with random fish names.

~ Don't listen to this guy, any board with the categories 'dinosaurs, spaceships, fried foods, wild animals, alien abductions, business casual, robots, and fireworks' has true potential.

 

Posted

What can I do to change that? I mean what could cause it ?

~ This has to be the worst board post I have ever read. It simply makes no sense. You start off by talking about space or something, then you randomly start babbling about cupcakes, and you end off with random fish names.

~ Don't listen to this guy, any board with the categories 'dinosaurs, spaceships, fried foods, wild animals, alien abductions, business casual, robots, and fireworks' has true potential.

 

Posted

Anyone please?

~ This has to be the worst board post I have ever read. It simply makes no sense. You start off by talking about space or something, then you randomly start babbling about cupcakes, and you end off with random fish names.

~ Don't listen to this guy, any board with the categories 'dinosaurs, spaceships, fried foods, wild animals, alien abductions, business casual, robots, and fireworks' has true potential.

 

Posted

I solved it by adding

lastTick = getTickCount( );

everytime the value changes, as FabioGNR advised

Thank you

~ This has to be the worst board post I have ever read. It simply makes no sense. You start off by talking about space or something, then you randomly start babbling about cupcakes, and you end off with random fish names.

~ Don't listen to this guy, any board with the categories 'dinosaurs, spaceships, fried foods, wild animals, alien abductions, business casual, robots, and fireworks' has true potential.

 

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