Jump to content

help me please


Recommended Posts

Hi I am creating an info panel. to give better appearance used interpolatebetween

Well what I want is that OutBounce Animation and dxDrawText start at the same time

Sorry if I can not explain me well

This is my client

local isPlayerViewingPanel = false 
local sw,sh = guiGetScreenSize() 
  
function main ( ) 
    if isPlayerViewingPanel then 
        start = getTickCount() 
        addEventHandler ( "onClientRender", root, dxDrawTheImage ) 
    else 
        removeEventHandler("onClientRender", root, dxDrawTheImage) 
    end 
end 
  
function dxDrawTheImage() 
    local x,y = guiGetScreenSize() 
    ancho=550 
    alto=480 
    local now = getTickCount() 
    local elapsedTime = now - start 
    local endTime = start + 1000 
    local duration = endTime - start 
    local progress = elapsedTime / duration 
    local x1, y1, z1 = interpolateBetween ( 0, 0, 0, ancho, alto, 255, progress, "OutBounce") 
    local x2, y2, z2 = interpolateBetween ( 0, 0, 0, ancho, alto, alto/11, progress, 'OutBounce') 
  
    posx = (x/2)-(x1/2) 
    posy = (y/2)-(y1/2) 
  
    dxDrawImage ( posx, ( sh / 2 - y2 / 2 ), x2, y2, "window.png" ) 
    dxDrawText ( "Rules", sw/2 - 26, sh/2 - 230, sw/2 + 175, sh/2 + 80, tocolor ( 255, 255, 255, 255 ), 1.6, "default-bold") 
    dxDrawText ( "Server Information", sw/2 - 260, sh/2 - 180, sw/2 + 175, sh/2 + 80, tocolor ( 255, 255, 255, 255 ), 1.7, "default-bold") 
end 
  
bindKey("f3", "down",function() 
    local toView = not isPlayerViewingPanel         
    isPlayerViewingPanel = toView 
    showCursor (toView) 
    main() 
end ) 

any help will be considered

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