Author Topic: Best way to dim the background of the GUI?  (Read 3986 times)

Kartzan

  • Guest
Best way to dim the background of the GUI?
« on: May 02, 2012, 01:55:55 PM »
I'm working on a game at the moment that has quite a few different UIs and we want the game in the background to be dimmed when one of the interfaces comes up. Has anyone figured out an easy way to make this happen? I've tried adding a large sprite behind the GUI and using iTween.FadeTo to ease it in and out, but that does not appear to work. Any thoughts?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Best way to dim the background of the GUI?
« Reply #1 on: May 02, 2012, 01:58:15 PM »
You mean how I did in Windward when you get popups? I have a screen-size background that has UIStretch and a collider on it to ensure that it covers the entire screen with a Z of -50 to make sure it's in front of everything. I then animate in a window that's on top of that with an even lower depth.

Kartzan

  • Guest
Re: Best way to dim the background of the GUI?
« Reply #2 on: May 02, 2012, 02:34:31 PM »
I actually decided to place a plane directly in front of the game camera and applied a transparent/diffuse shader to it and now I can modulate the color and transparency of the game view for whatever the situation calls for. So for now I can make the scene darker when I bring in GUI and then fade in when the GUI leaves. I realize I may face a performance problem but for now its working fine.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Best way to dim the background of the GUI?
« Reply #3 on: May 02, 2012, 05:32:06 PM »
Either way is good Kartzan. The way Aren suggests is good if you want gui on top of gui, like a popup.