Jump to content

DxDraw Animation - Help :(


Recommended Posts

Posted
startX, startY = 0, 0; -- starting position 
endX, endY = 300, 300; -- ending position 
t = 1; -- time 
  
addEventHandler ( "onClientReosurceStart", resourceRoot, 
    function ( ) 
        local startTime = getTickCount ( ); 
        local duration = t * 1000; 
        local render = function ( ) 
            local elapsedTime = getTickCount ( ) - startTime; 
            local progress = elapsedTime / duration; 
             
            local x, y = interpolateBetween ( startX, startY, 0, endX, endY, 0, progress, "OutBounce" ); 
            dxDrawImage ( x, y, 197, 105, "logo.png", 0, 0, 0, tocolor ( 255, 255, 255, 255 ), false ); 
        end 
        addEventHandler ( "onClientRender", root, render ); 
    end 
); 

Should work, didn't test.

Posted

dxDrawImage doesn't return an element. If you want to destroy it, you have to removeEventHandler ("onClientRender") from render function.

Posted
Why :/

Beacause you come here for help and if someone need help we can send him directly to this post and he can solve the problem faster. That's why!

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