Jump to content

How ?


z24d

Recommended Posts

السلام عليكم

ابي اخلي كلام دي اكس يسوي مثل الفلشر يطلع ويختفي يطلع ويختفي يطلع ويختفي

بس ابيه بالتدريج شلون؟

ترا ادري السالفة فيها تايمر لكن الي اعرفه ان التايمر يسوي الشيء بعد مدة معينة ماهو يسوي شيء بالتدريج

وسنكث يو نبي ردود سريعة : (

Link to comment
local Alpha = 255 
local AlphaDown = true 
  
addEventHandler( "onClientRender", root, 
function() 
    if ( AlphaDown ) then 
        if ( Alpha >= 255 ) then 
            Alpha = 254 
        elseif ( Alpha < 255 ) and ( Alpha > 0 ) then 
            Alpha = Alpha - 1 
        elseif ( Alpha <= 0 ) then 
            Alpha = 1 
            AlphaDown = not AlphaDown 
        end 
    else 
        if ( Alpha >= 255 ) then 
            Alpha = 254 
            AlphaDown = not AlphaDown 
        elseif ( Alpha < 255 ) and ( Alpha > 0 ) then 
            Alpha = Alpha + 1 
        elseif ( Alpha <= 0 ) then 
            Alpha = 1 
        end 
    end 
    dxDrawText ( "الكلام", left, top, right, bottom, tocolor( 255, 255, 255, Alpha ), 1, "default-bold", "center", "center", false, false, false, true ) 
end) 

Link to comment
local timeToFade = 2000 
local fadeStart, fadeEnd = 0, 255 
  
addEventHandler("onClientRender", root, 
function() 
    if not start then start = getTickCount() end 
    local prog = (getTickCount() - start)/((start + timeToFade) - start) 
    local alpha = interpolateBetween(fadeStart, 0, 0, fadeEnd, 0, 0, prog, "SineCurve") 
    dxDrawText("Hello World", 500, 500, 500, 500, tocolor(255, 255, 255, alpha), 1, "default-bold", "center", "center", false, false, false, true) 
end) 

Link to comment
local timeToFade = 2000 
local fadeStart, fadeEnd = 0, 255 
  
addEventHandler("onClientRender", root, 
function() 
    if not start then start = getTickCount() end 
    local prog = (getTickCount() - start)/((start + timeToFade) - start) 
    local alpha = interpolateBetween(fadeStart, 0, 0, fadeEnd, 0, 0, prog, "SineCurve") 
    dxDrawText("Hello World", 500, 500, 500, 500, tocolor(255, 255, 255, alpha), 1, "default-bold", "center", "center", false, false, false, true) 
end) 

ما جات على بالي

interpolateBetween 

. المهم أن الطريقتين صح

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