Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: mrscruff on July 15, 2014, 06:35:34 PM

Title: overlapping
Post by: mrscruff on July 15, 2014, 06:35:34 PM

Hi there,

I have two buttons, 1 and 2. When I click on 1 the first time, text appear, then I click on 1 text disappear. everything is ok so far.

But, when I click on 1, text appear, and then on 2, text appear, so I have an overlapping ..

Does someone can explain how to correct this ?

thanks a lot
Title: Re: overlapping
Post by: ArenMook on July 15, 2014, 11:47:40 PM
Don't overlap it? :P

Or just hide the other one when you show something. It seems rather obvious so I am not sure if I understood the question correctly...
Title: Re: overlapping
Post by: mrscruff on July 16, 2014, 12:01:42 PM

Yes I would like to do : hide or disable button 2 when I click on button 1 for example.

but how I can do this ?

Im using UItoggle & UIbutton  script

Title: Re: overlapping
Post by: mrscruff on July 16, 2014, 04:20:44 PM

for the moment I attached this script on my button 2 :

  1. function Start () {
  2.  
  3. gameObject.SetActive(false);
  4.  
  5. }
  6.  
  7. function Update () {
  8.  
  9. }


Does someone can help me to say in js, '' if I click on button 1 , button 2 is no working, if I click on button 2, button 2 working but button 1 is inactive" ?

Title: Re: overlapping
Post by: ArenMook on July 17, 2014, 02:33:48 AM
Put your toggle into a group. If it's in a group, only one can be active at a time and toggling one will automatically turn off the other.
Title: Re: overlapping
Post by: mrscruff on July 17, 2014, 12:12:28 PM
:/ what do you mean by " in a group" ? 
Title: Re: overlapping
Post by: ArenMook on July 18, 2014, 04:46:11 AM
UIToggle.group: http://www.tasharen.com/ngui/docs/class_u_i_toggle.html#a11cfdeec745a2cb123488c4423b5ae22