Author Topic: Using NGUI to create tab pages  (Read 8635 times)

wsycarlos

  • Guest
Using NGUI to create tab pages
« on: November 20, 2012, 10:21:26 PM »
Anyone has good idea for how to create a window with tab pages like web browser windows using NGUI?
Or are there any demos or tools for it? Thank you!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Using NGUI to create tab pages
« Reply #1 on: November 21, 2012, 01:45:07 AM »
Create more than one pages on top of each other (think: one panel per page). Each tab will activate one panel, and deactivate all others.

PalverZ

  • Guest
Re: Using NGUI to create tab pages
« Reply #2 on: December 26, 2012, 05:48:03 PM »
Sorry to drag up an old post, thanks for a great plugin.

I have been beating my head against a wall trying different methods to do tabs and I concluded that the above would be the way I needed to do it but it leads me to a question I cannot find the answer:

How the heck do you disable a panel? I know its got to be easy as pie and Im just over looking probably a native function to unity.

  1.         public GameObject ButtonActivates;
  2.         private GameObject[] list;
  3.        
  4.         void OnClick() {
  5.                 if (list==null) GameObject.FindGameObjectsWithTag("PanelObject");
  6.                
  7.                 foreach (GameObject target in list)
  8.                 {
  9.                         //NGUITools.SetActive(target, false);
  10.                         //NGUITools.SetLayer(target, 0);
  11.                         //target.SetActive(false);     
  12.                        
  13.                 }
  14.                 //NGUITools.SetActive(ButtonActivates, true);
  15.                 //NGUITools.SetLayer(ButtonActivates,1);
  16.                 //ButtonActivates.SetActive(true);
  17.         }


I commented out the things I DID try before I found this posting.

PalverZ

  • Guest
Re: Using NGUI to create tab pages
« Reply #3 on: December 26, 2012, 05:56:27 PM »
Oh Doi I fixed it..... When I copy and pasted my code I found I had OnClik() instead of OnClick()..... that was keeping me from getting the console warning that my list was never being populated, so I fixed that and now got it working with the target.SetActive()..... Ha ha  :-[