Jump to content

DxDraw Animation - Help :(


Recommended Posts

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.

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