Search Unity

transparent and alpha

Discussion in 'Immediate Mode GUI (IMGUI)' started by half_voxel, Dec 23, 2007.

  1. half_voxel

    half_voxel

    Joined:
    Oct 20, 2007
    Posts:
    978
    Hi.

    I'm trying to make an gui menu that i can make transparent so it can for example increase the alpha with one all the time so it fades in.

    I have tried to use GUI.a = 0; and some similar things but i cant get it working.

    I have done it on gui textures but now i need to do it on a button.

    Any suggestions :?:
     
  2. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    try GUI.color.a
     
  3. shaun

    shaun

    Joined:
    Mar 23, 2007
    Posts:
    728
    Give GUI.color() a try. Remember the GUI runs in immediate mode, so don't forget to change it back once you're done.

    EDIT:geez Nicholas, you're fast today :)
     
  4. half_voxel

    half_voxel

    Joined:
    Oct 20, 2007
    Posts:
    978
    can you give a script sample because it won't work for me


    Code (csharp):
    1. GUI.color.a = 0;
    or


    Code (csharp):
    1. GUI.color(0,0,0,0);
     
  5. half_voxel

    half_voxel

    Joined:
    Oct 20, 2007
    Posts:
    978
    Oh.

    um now it works seams that i have forgotten to place the code in the ongui function.

    Thanks for the help :D