KAT14U Posted July 15, 2016 Share Posted July 15, 2016 Hey guys, i want to make a alpha effect like this: I have a code, but idk what i need do after this local start = getTickCount() local now = getTickCount() local ALPHA = interpolateBetween(255, 0, 0, 0, 0, 0, (now - start) / ((start + 5000) - start), "SineCurve") dxDrawText("TEXT", sX*795-width2+width2, sX*695, sX*628, sY*710, tocolor(255, 255, 255, APHA), 1, "default-bold", "center", "center", false, false, false, true, false) Sorry for my bad english. Link to comment
N3xT Posted July 15, 2016 Share Posted July 15, 2016 Change line 4 to your text. local sx,sy = guiGetScreenSize() local px,py = 1920,1080 local x,y = (sx/px), (sy/py) local text = "TEST" local N = {} function N2() local now = getTickCount() local elapsedTime = now - N.startTime local duration = N.endTime - N.startTime local progress = elapsedTime / duration local width, _, _ = interpolateBetween ( N.startSize[1], 0, 0, N.endSize[1],0, 0, progress, "OutQuad") dxDrawText(text, x*1100, y*24, x*787, x*119, tocolor(255, 255, 255, width), 3.00, "default-bold", "center", "top", false, false, false, false, false) if now >= N.endTime then removeEventHandler("onClientRender",root,N2) end end function N1() local now = getTickCount() local elapsedTime = now - N.startTime local duration = N.endTime - N.startTime local progress = elapsedTime / duration local width, _, _ = interpolateBetween ( N.startSize[1], 0, 0, N.endSize[1],0, 0, progress, "OutQuad") dxDrawText(text, x*1100, y*24, x*787, x*119, tocolor(255, 255, 255, width), 3.00, "default-bold", "center", "top", false, false, false, false, false) if now >= N.endTime then addEventHandler("onClientRender",root,N2) end end addEventHandler( "onClientResourceStart", getRootElement( ), function () N.startTime = getTickCount() N.startSize = {0} N.endSize = {255} N.endTime = N.startTime + 5000 addEventHandler("onClientRender", getRootElement(), N1) dr = setTimer ( function() N.startTime = getTickCount() N.startSize = {255} N.endSize = {0} N.endTime = N.startTime + 5000 addEventHandler("onClientRender", getRootElement(), N2) end, 10000, 1 ) end ) 1 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