Jump to content

dxDrawAnim Problem


Kevin1003

Recommended Posts

Hello to all I have done this script and it works fine.. but I want that closes with the same animation ( of the open) without disappearing suddenly. (I'm using GUI Interpolate Effects ) Thanks.

Code:

local gRoot = getRootElement() 
local start = getTickCount() 
local one, one1 = 5, 5  
local two, two1 = 50, 50  
  
  
function content() 
    local now = getTickCount() 
    local x,y = interpolateBetween(one, one1, 0, two, two1, 0, (now - start) / ((start + 1500) - start), "Linear") 
    dxDrawRectangle(x,y, 480, 750, tocolor(0, 0, 0, 130), false) 
end 
function open() 
opened = not opened 
if opened == true then 
start = getTickCount() 
addEventHandler ( "onClientRender", gRoot, content ) 
else 
removeEventHandler( "onClientRender", gRoot, content ) 
end 
end 
bindKey("F2","down",open) 
  

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