Author Topic: Set toggle to none?  (Read 1670 times)

redbeef88

  • Guest
Set toggle to none?
« on: October 24, 2013, 01:26:50 AM »
I can see in the docs that the UIToggle class has a 'option can be none' public attribute (http://www.tasharen.com/ngui/docs/class_u_i_toggle.html#acab8b1d04ff9834035b4beb39d5c3205 ) but I am having trouble 'deselecting' the toggles to hide both the tabs in the supplied example.

I have 2 tabs set up as toggles, and 2 UIPanels containing content that switches on and off depending on the toggle.

When I run the app, nothing is selected so both UIPanel content is disabled.

When I hit tab 1, content 1 shows.

When I hit tab 2, content 1 hides and content 2 shows.

Now I want to get back to the stage when both UIPanels were disabled, so I assume there's a way to set the toggle back to 'none'?

I also script in JS.

Thanks in advance, loving NGUI!
G

redbeef88

  • Guest
Re: Set toggle to none?
« Reply #1 on: October 24, 2013, 05:39:56 PM »
ok, I have a suspicion that I need to use 'UIToggle.value', and somehow access it to set 'value = false'.
The problem is that I am not sure how to traverse to the UIToggle component in my tab sprite object, any advice?
Thanks!
G

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Set toggle to none?
« Reply #2 on: October 24, 2013, 09:28:41 PM »
Just click the toggle again, and it will be un-toggled.