Jump to content

[help]Bounce


TheSmart

Recommended Posts

Hello guys!

today i was going to make something but i want to add special thing on it so i decided to add bouncing in dx gui but i don't know how to use it, i try to understand InterpolateBetween but i failed can someone give me example to how to make it.

i want dx bounce start from here

  dxDrawRectangle(147, 120, 237, 48, tocolor(255, 255, 255, 255), false) 

and end to here

  dxDrawRectangle(147, 424, 237, 48, tocolor(255, 255, 255, 255), false) 

Hope you understand my BAD English :mrgreen::mrgreen:

Link to comment

Aik simple example write ki hai.

  
local start = getTickCount() 
local time = start + 7000 
addEventHandler("onClientRender", root, 
function () 
    local now = getTickCount() 
    local elapsedTime = now - start 
    local duration = time - start 
    local progress = elapsedTime / duration 
  
local _, y = interpolateBetween (  
        0, 600, 0, 
        0, 300, 0,  
        progress, "OutBounce") 
  
dxDrawRectangle(147, y, 237, 48, tocolor(255, 255, 255, 255), false) 
  
end ) 
  

EDIT: thodi se modify kerli hai.

Link to comment
Aik simple example write ki hai.
  
local start = getTickCount() 
local time = start + 7000 
addEventHandler("onClientRender", root, 
function () 
    local now = getTickCount() 
    local elapsedTime = now - start 
    local duration = time - start 
    local progress = elapsedTime / duration 
  
local _, y = interpolateBetween (  
        0, 600, 0, 
        0, 300, 0,  
        progress, "OutBounce") 
  
dxDrawRectangle(147, y, 237, 48, tocolor(255, 255, 255, 255), false) 
  
end ) 
  

EDIT: thodi se modify kerli hai.

Thanks yar.. 8)8)

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