Author Topic: overlapping  (Read 3245 times)

mrscruff

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
overlapping
« 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

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: overlapping
« Reply #1 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...

mrscruff

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: overlapping
« Reply #2 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


mrscruff

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: overlapping
« Reply #3 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" ?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: overlapping
« Reply #4 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.

mrscruff

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: overlapping
« Reply #5 on: July 17, 2014, 12:12:28 PM »
:/ what do you mean by " in a group" ? 

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile