Jump to content

#Transparent opening..!


Recommended Posts

Hi Guys.

Im work on the help panel.

I tried to make the opening of the panel to be transparent. But the "R" Nothing happens when I press the button. Also its not give error and warning on debugscript.

Im how to make the transparent opening?

function open() 
    if (guiGetVisible (helpMenu) == true) then 
        if guiGetAlpha(helpMenu) >= 65 then  
        setTimer(function()  
        if not guiGetAlpha(helpMenu) <= 0 then 
        guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)-5)) 
        end 
        end,50,0) 
            guiSetVisible(helpMenu, false) 
            showCursor(false) 
        end 
    elseif (guiGetVisible (helpMenu) == false) then 
        if guiGetAlpha(helpMenu) <= 0 then  
        setTimer(function()  
        if not guiGetAlpha(helpMenu) >= 65 then 
        guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)+5)) 
        end 
        end,50,0) 
            guiSetVisible(helpMenu, true) 
            showCursor(true) 
        end 
    end 
end 
bindKey ("R", "down", open) 

Link to comment

Try

local timer; 
  
function open() 
    if (guiGetVisible (helpMenu) == true) then 
        if isTimer ( timer ) then killTimer ( timer ) end 
        timer = setTimer(function()  
        if not guiGetAlpha(helpMenu) <= 0 then 
           guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)-5)) 
         else 
            guiSetVisible(helpMenu, false) 
            showCursor(false) 
            killTimer(timer) 
        end 
        end,50,0) 
    elseif (guiGetVisible (helpMenu) == false) then 
        if isTimer ( timer ) then killTimer ( timer ) end  
        timer = setTimer(function()  
        if not guiGetAlpha(helpMenu) >= 65 then 
           guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)+5)) 
         else 
            guiSetVisible(helpMenu, true) 
            showCursor(true) 
            killTimer(timer) 
        end 
        end,50,0) 
     end 
end 
bindKey ("R", "down", open) 

Link to comment
Try
local timer; 
  
function open() 
    if (guiGetVisible (helpMenu) == true) then 
        if isTimer ( timer ) then killTimer ( timer ) end 
        timer = setTimer(function()  
        if not guiGetAlpha(helpMenu) <= 0 then 
           guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)-5)) 
         else 
            guiSetVisible(helpMenu, false) 
            showCursor(false) 
            killTimer(timer) 
        end 
        end,50,0) 
    elseif (guiGetVisible (helpMenu) == false) then 
        if isTimer ( timer ) then killTimer ( timer ) end  
        timer = setTimer(function()  
        if not guiGetAlpha(helpMenu) >= 65 then -- Line 85 
           guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)+5)) 
         else 
            guiSetVisible(helpMenu, true) 
            showCursor(true) 
            killTimer(timer) 
        end 
        end,50,0) 
     end 
end 
bindKey ("R", "down", open) 

It's not work..! :( ;

NVBEQk.png

Link to comment

P.S : u can use function ( setAlphaGradually ) for all GUI Elements .

setAlphaGradually = function( element, Speed ) 
  if ( isElement( element ) and getElementType( element ):find( "gui-" ) and tonumber( Speed ) and tonumber( Speed ) >= 50 ) then 
    if ( isTimer( Timer ) ) then killTimer( Timer ) end 
     guiSetAlpha ( element, 0 ) 
     Timer = setTimer ( function (   )  
        guiSetAlpha ( element, guiGetAlpha ( element ) + 0.03 ) 
          if ( guiGetAlpha ( element ) == 1 ) then 
               killTimer( Timer ) 
           end 
        end, Speed, 0 ) 
     else 
        return false       
   end 
end 
         
bindKey( "R", "down", function(  ) 
    setAlphaGradually( helpMenu, 70 ) 
    guiSetVisible( helpMenu, not guiGetVisible( helpMenu ) ) 
    showCursor( guiGetVisible( helpMenu ) ) 
end ) 
Link to comment
local timer; 
  
function open() 
    if (guiGetVisible (helpMenu) == true) then 
        if isTimer ( timer ) then killTimer ( timer ) end 
        timer = setTimer(function()  
        if not guiGetAlpha(helpMenu) <= 0 then 
           guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)-0.05)) 
         else 
            guiSetVisible(helpMenu, false) 
            showCursor(false) 
            killTimer(timer) 
        end 
        end,50,0) 
    elseif (guiGetVisible (helpMenu) == false) then 
        if isTimer ( timer ) then killTimer ( timer ) end  
        guiSetVisible(helpMenu, true) 
        guiSetAlpha(helpMenu, 0) 
        timer = setTimer(function()  
        if not guiGetAlpha(helpMenu) >= 0.65 then -- Line 85 
           guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)+0.05)) 
         else 
            showCursor(true) 
            killTimer(timer) 
        end 
        end,50,0) 
     end 
end 
bindKey ("R", "down", open) 

Link to comment
local timer; 
  
function open() 
    if (guiGetVisible (helpMenu) == true) then 
        if isTimer ( timer ) then killTimer ( timer ) end 
        timer = setTimer(function()  
        if not guiGetAlpha(helpMenu) <= 0 then 
           guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)-0.05)) 
         else 
            guiSetVisible(helpMenu, false) 
            showCursor(false) 
            killTimer(timer) 
        end 
        end,50,0) 
    elseif (guiGetVisible (helpMenu) == false) then 
        if isTimer ( timer ) then killTimer ( timer ) end  
        guiSetVisible(helpMenu, true) 
        guiSetAlpha(helpMenu, 0) 
        timer = setTimer(function()  
        if not guiGetAlpha(helpMenu) >= 0.65 then -- Line 85 
           guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)+0.05)) 
         else 
            showCursor(true) 
            killTimer(timer) 
        end 
        end,50,0) 
     end 
end 
bindKey ("R", "down", open) 

It's not work.

It's solved. Thank you # ZĀ!ـحF ๛..!

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