Search Unity

Fade screen in and out

Discussion in 'Immediate Mode GUI (IMGUI)' started by theinfomercial, Feb 28, 2009.

  1. theinfomercial

    theinfomercial

    Joined:
    Sep 9, 2008
    Posts:
    1,000
    Hi guys! Anyone know of a way to have the screen fade to and from black when the level gets loaded?

    Keep in mind that I have GUI elements (OnGUI buttons) on screen as well, and I want them to fade with the screen. I'm sure it possible.

    I'm playing with Unity's GUI and I must say, it's flexible from what I can tell, but pretty difficult to use without constantly tweaking it. I'm amazed UT hasn't struck a deal with Jeremy to integrate GUIX into Unity GUI. Because GUIX is exactly what Unity's GUI system needs. :)
     
  2. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,066
    Look at the script in the wiki:
    http://unifycommunity.com/wiki/index.php?title=FadeInOut
    (A simple JavaScript version from PsychicParrot and an improved Boo version from me that you can use from JavaScript if you put it into the Stnadard Assets folder).

    To also fade your GUI elements you need to set drawDepht/guiDepth to be above all your controls.
     
  3. theinfomercial

    theinfomercial

    Joined:
    Sep 9, 2008
    Posts:
    1,000
    Thanks Adrian (and you too Psychic Parrot)! Script works like a charm! :D
     
  4. Arsinx

    Arsinx

    Joined:
    Apr 14, 2014
    Posts:
    55
    The Link is broken.
     
  5. DougMcFarlane

    DougMcFarlane

    Joined:
    Apr 25, 2009
    Posts:
    197