Author Topic: Custom folding tabs  (Read 8576 times)

Redeemerbansal

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 4
    • View Profile
Custom folding tabs
« on: January 12, 2015, 05:52:18 AM »
Hello,

Ngui is a great package... I was recently looking into example 9 quest log scene ... And I am trying to make a small modification... I am trying to make the interface react in such a way that if I select one quest tab, either of the other two or both quest tabs if open would automatically collapse.
Now I have tried changing the trigger type in UIButtonTween which are attached to the sliced sprites from OnClick to OnSelect and turns out it kind of works but if I click anywhere else on the screen except where the collider tabs are all the quest tabs collapse.
I merely want that the one I select expands and others collapse on pressing the said tab but I don't want any changes to the interface if I click on any other part of the screen.
 Also I am trying to get it to collapse if I select the same tab twice without changes to the other closed tab.

Could you direct me further on how to make this work,
Thanks,

Red

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Custom folding tabs
« Reply #1 on: January 13, 2015, 05:16:17 PM »
What you're basically trying to do is replicate how toggles work. Have a look at UIToggle that comes with NGUI. When you give a bunch of toggles the same group, they work as an option group -- so only one can be active at a time.

Redeemerbansal

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Custom folding tabs
« Reply #2 on: January 14, 2015, 04:57:34 AM »
Thanks for the reply, but I am new to ngui. Is UIToggle a script .?... How do I access it ?.. I do want to look into this because it seems to be a useful feature for UI.

Thanks,
Red

r.pedra

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 20
  • Posts: 131
    • View Profile
Re: Custom folding tabs
« Reply #3 on: January 14, 2015, 10:34:45 AM »
Yes this is a script and you just enter Toggle in the search field of Unity

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Custom folding tabs
« Reply #4 on: January 14, 2015, 09:48:50 PM »

Redeemerbansal

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Custom folding tabs
« Reply #5 on: January 15, 2015, 12:04:35 AM »
Searched for it ... Can't find it though in the project tab...  although there is a "play direction" enum type in UIButtonTween having states ... Toggle, Reverse and Forward. But even setting these states in code doesn't seem to have the right effect...

Red.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Custom folding tabs
« Reply #6 on: January 15, 2015, 07:10:36 PM »
If you can't find it, then you are using NGUI 2, which is not what this support forum is for.

Redeemerbansal

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Custom folding tabs
« Reply #7 on: January 16, 2015, 12:00:10 AM »
My apologies ... I had the version from the asset store that I had downloaded some months back but just started playing with it and used the forum for the first time.

Red.