Jump to content

x[ إستفسار ]x كيف تجعل اللوحة تتدرج من الفا 0 الي الفا 100


Recommended Posts

setElementAlpha --تغير الفا اللوحه 
getElementAlpha -- تجيب الفا اللوحه 
setTimer --تايمر , وقت 
killTimer --يلغي الوقت 

مسوي وقت كل جزء من الثانيه يحيب لو كانت الفا اقل من 100 يزيد لها 5 يعني مثلا كانت 50 , بعد جزء من الثانيه تصير 55, ولو كان اكثر من 100 الفا يلغي التايمر

Link to comment

ذا مثال بسيط ..

guiWindowSetAlpha = function ( win ) 
    if win and getElementType ( win ) == 'gui-window' then 
        timer = setTimer ( function ()  
            if not start then start = getTickCount () end 
            if not en then  en = getTickCount ()+3500 end 
            local now = getTickCount () 
            guiSetAlpha ( win, ( ( now - start ) / ( en - start ) ) ) 
            if guiGetAlpha ( win ) == 1 and isTimer (timer) then killTimer ( timer ) timer = nil end 
        end,100,0) 
    end 
end 
  
w = guiCreateWindow ( 0.1, 0.1, 0.5, 0.3, '', true) 
guiSetVisible ( w, false ) 
  
bindKey ( 'f2', 'down', function ( ) 
    guiSetVisible ( w, true ) 
    guiWindowSetAlpha ( w ) 
        showCursor ( true ) 
end) 
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...