Author Topic: Two quick questions about disabling/greying out widgets and panels  (Read 835 times)

Trithilon

  • Guest
Two quick questions about disabling/greying out widgets and panels
« on: September 23, 2012, 05:44:47 AM »
How do you grey out a checkbox/button and disable its functionality?

When we go ahead with panel transitions - how do we disable all the interactions possible on all the widgets of the panel while fading in-out till the next panel comes in?

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Two quick questions about disabling/greying out widgets and panels
« Reply #1 on: September 23, 2012, 09:31:46 AM »
Disable its collider and you disable the ability to interact with it. Change its color to something like grey, and you make it look disabled. Same thing with the panel transitions -- disable the colliders when you start the transition, enable them when the transition finishes.

Trithilon

  • Guest
Re: Two quick questions about disabling/greying out widgets and panels
« Reply #2 on: September 23, 2012, 09:59:58 AM »
So if I have - say 20 widgets on a panel - I have to call 20 functions from a custom script to disable all of those colliders?
I thought there might have been a function like that similar to the one you have for controlling the alpha for an entire panel.
If there isn't I believe - it would make for a great addition to the Framework. :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Two quick questions about disabling/greying out widgets and panels
« Reply #3 on: September 23, 2012, 05:45:01 PM »
Why would you? GetComponentsInChildren<Collider>() on the panel gives you all of the colliders. Foreach through them and enable/disable them as needed -- that's two lines of code.