Jump to content

[Useful Function] fade in/out loop for gui windows


FIY9AL

Recommended Posts

this function will fade out your window till it disapperas then it will be fade in till it being fully visable

you can edit it to be fade in/out when command triggerd or bindkey pressed

fadeStatus = true
function fading()
     local fadeRatioPerRender = 0.005
     if (fadeStatus == true) then
          local alpha = guiGetAlpha(window_logo)
          guiSetAlpha(window_logo, alpha-fadeRatioPerRender)
          if (alpha == 0) then
               fadeStatus = false
          end
     else
          local alpha = guiGetAlpha(window_logo)
          guiSetAlpha(window_logo, alpha+fadeRatioPerRender)
          if (alpha == 1) then
               fadeStatus = true
          end
     end
end
addEventHandler("onClientRender", root, fading)

 

  • Like 1
Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...