Jump to content

Fade text


S3Nn4oXx

Recommended Posts

Use interpolation for example.

  
local sw, sh = guiGetScreenSize() 
  
function getProgress( addtick ) 
    local now = getTickCount() 
    local elapsedTime = now - start 
    local duration = start+addtick - start 
    local progress = elapsedTime / duration 
    return progress 
end 
  
function render() 
local alpha = interpolateBetween(255, 0, 0, 0, 0, 0, getProgress(5000), "Linear") -- Linear fading text in 5 seconds 
dxDrawText("something", sw/2, sh/2, 0, 0, tocolor(255,255,255, alpha), 1, "sans") 
if alpha < 20 then 
removeEventHandler("onClientRender", root, render) 
end 
end 
  
function something() 
start = getTickCount() 
addEventHandler("onClientRender", root, render) 
end 
  

something like that

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