Author Topic: Buttons fading out after upgrade to latest version  (Read 4301 times)

oxyscythe

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Buttons fading out after upgrade to latest version
« on: July 15, 2014, 06:19:24 PM »
Hello! First post so apologies for potentially newbish question!

I just upgraded to the latest version and I am having a weird issue where a bunch of buttons in my scene are fading out completely (become invisible) after I hover away from them. So more specifically, the buttons show up, then I hover on them and they do their colour tweening, then I hover out and they disappear.

There's nothing really special about these buttons either, I had created them using the "Simple Button" prefab from a previous version of NGUI and just changed the sprite to use a sprite of my choosing. Just to reiterate too: these were working fine, it's only after grabbing the latest version that I started experiencing this

Thanks in advance! (and also, since it's my first post, thanks for NGUI itself, it's a great piece of software!)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Buttons fading out after upgrade to latest version
« Reply #1 on: July 15, 2014, 11:45:28 PM »
Which version did you upgrade from? What's different in your buttons versus the buttons that come with NGUI? (Remember, the Prefab Toolbar contains pre-made button prefabs)

oxyscythe

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: Buttons fading out after upgrade to latest version
« Reply #2 on: July 16, 2014, 05:06:23 PM »
Ooh...good question. I am not quite sure I am afraid. I hadn't done an upgrade in a long time. Looking at the old package modification date it dates back to Dec 2013 if that gives you any ideas. Also I previously didn't have the prefab toolbar at all. I spawned these buttons using the Simple Button prefab from the NGUI folder and then just changed the sprite so nothing really special.

It's not a big deal, I will just recreate them from scratch using the new prefabs. Just curious as to why this might have happened more than anything.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Buttons fading out after upgrade to latest version
« Reply #3 on: July 17, 2014, 02:38:36 AM »
December last year... that's pretty old, likely around 3.0.7. I don't think alpha was nested back then. Currently if you fade out some widget, all its children get faded out automatically.

oxyscythe

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: Buttons fading out after upgrade to latest version
« Reply #4 on: July 19, 2014, 06:33:49 PM »
Indeed, must be some version incompatibility thing as I replaced the old Simple Buttons with new Simple Buttons from the latest version and the problem seems to go away.

I am having a new (smaller) problem now though which is, the new buttons don't seem to respect the fact that the UIButton component is disabled on the gameobject at startup?

Basically I have these buttons hidden (UIButton disabled in the editor) and they become enabled at some point through script. The previous buttons worked fine in this regard, now when I disable the UIButton component in the editor the button is still visible. This is actually the case in the editor too, toggling UIButton does not hide the button sprite (before it did). I thought maybe the rendering of the button has been decoupled from the UIButton component in this last version, but then actually when I keep toggling their state when the game is running, they do disappeared on subsequent runs of the script that disables the UIButton component. It seems to be only during startup that this isn't respected. Like the editor setting does not persist during startup. Is this possible?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Buttons fading out after upgrade to latest version
« Reply #5 on: July 20, 2014, 12:25:42 PM »
UIButton is a script. Toggling it won't hide anything. If you want to make the button invisible, you need to disable the entire game object.