S3Nn4oXx Posted October 23, 2015 Share Posted October 23, 2015 How to make fade text every second and after 2 seconds it It disappeared Thanks. Link to comment
AMARANT Posted October 23, 2015 Share Posted October 23, 2015 How to make fade text every second and after 2 seconds it It disappearedThanks. Change alpha of your text in render. Link to comment
Jurandovsky Posted October 23, 2015 Share Posted October 23, 2015 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now