Author Topic: TweenAlpha on UIPanel not fading the panel  (Read 4117 times)

mvesich

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
TweenAlpha on UIPanel not fading the panel
« on: May 04, 2014, 11:10:46 PM »
I have multiple menu pages set up, all except this troublesome one work. I've been staring at this too long and need some ideas as the configuration looks the same as those that work and the boundaries are all correct for the buttons. I have the following hierarchy for reference with the *'ed Scroll panel being the culprit:

- Menu (UIPanel, Rigidbody, TweenAlpha)
  - Background (UISprite)
  - Panel Name (UILabel)
  * Scroll List (UIPanel, UIScrollView, Rigidbody, TweenAlpha)
    - Grid (UIGrid)
      - Dynamically added buttons.

The problem is strictly related to the Alpha in that I use the *.Play in script to run them. Problem is, my Menu panel will fade in and out correctly, but the Scroll panel is either ON or OFF, even though I can actually watch the Alpha value in the Inspector change gradually with each update when the app runs.

Question #1:  Anyone have any ideas what would cause this?
Question #2:  In the editor, I can control the Alpha of the Menu panel and everything including the buttons fade IN/OUT. Can I simply Play that top level Tween to fade it all at run-time just as done in the editor? (I know I can re-write to use UIPlayTween, but I'm curious if the single TweenAlpha should do it as the editor demonstrates.)



ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TweenAlpha on UIPanel not fading the panel
« Reply #1 on: May 05, 2014, 11:11:23 PM »
TweenAlpha.Begin adjusts the alpha of the widget it's attached to the same way as modifying it in inspector would. Which object are you actually using TweenAlpha on? Also, what version of NGUI are you using?

mvesich

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: TweenAlpha on UIPanel not fading the panel
« Reply #2 on: May 05, 2014, 11:24:49 PM »
I'm currently using 3.0.7 RC2, I know I have an update do but was focused on converting the animation to Mecanim and figured if my menus weren't broke, don't touch them (yet). I see the irony, but have assumed the problem is "pilot error", not API/classes.

As far as the tweening:
...the Menu (UIPanel, Rigidbody, TweenAlpha) panel fades currectly
...the Scroll List (UIPanel, UIScrollView, Rigidbody, TweenAlpha) panel is toggling On/Off as opposed to fade.

I had implemented UIPlayTween as a test on the Menu panel, but encountered the same issue with the child Scroll List even though I set includeChildren = True. I went back to my previous method to simplify and narrow my problem.
« Last Edit: May 05, 2014, 11:53:42 PM by mvesich »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TweenAlpha on UIPanel not fading the panel
« Reply #3 on: May 06, 2014, 12:00:50 AM »
Yeah... that's old. 3.0.7 doesn't have cumulative alpha IIRC. Please update first. There isn't much I can help you with on such an old version of NGUI.

mvesich

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: TweenAlpha on UIPanel not fading the panel
« Reply #4 on: May 06, 2014, 12:33:51 AM »
Will do! I'll get back to you if need be. (And this is why you tell us...."make sure you're running the latest version"....I'm sure.)

mvesich

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: TweenAlpha on UIPanel not fading the panel
« Reply #5 on: May 06, 2014, 12:42:20 AM »
Thanks ArenMook, once again if I had followed your premise of staying up to date as opposed to my version control, it'd been resolved. My panel fades correctly using the UIPlayTween on a control object that I just put in place. I think management object like that will ensure more predictable results and less code.

Thanks for your work and professionalism. I'm always happy using & recommending your code.