Author Topic: Issue with TweenAlpha on ScrollView [RESOLVED]  (Read 4467 times)

memetic arts

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Issue with TweenAlpha on ScrollView [RESOLVED]
« on: January 06, 2014, 10:52:18 PM »
Hello All,

I'm running NGUI 3.0.8 f6, in Unity 4.3.2, OS X 10.9.1 -- so the latest of everything.
I've spent a fair amount of time Googling, reading docs, experimenting, and have reached my wits end . . .

I'm implementing a modal window that contains the settings for an app I'm building, which is made visible by clicking a toolbar button that notifies the modal's TweenAlpha.  One of the settings in this modal requires the use of a ScrollView.

The problem is that when the modal appears, the ScrollView items do not.

As one line of experimentation, I added an additional TweenAlpha on the ScrollView itself, but that didn't work.

What I did find, however, is that if I run the modal's TweenAlpha on Start, without clicking the button, the ScrollView shows up.  Consequently, when I dismiss it (with a button in the modal), and open it back up with the toolbar button, everything appears as it should.

So it seems that unless the modal's TweenAlpha runs on Start, the ScrollView never responds to the notification coming from the button.

I'd really appreciate some guidance here. . .hopefully I've just missed something simple/obvious.

Thanks very much in advance,

==rr

memetic arts
digital media publishing

http://www.memeticarts.com

« Last Edit: January 09, 2014, 03:52:26 PM by memetic arts »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Issue with TweenAlpha on ScrollView
« Reply #1 on: January 07, 2014, 09:12:16 AM »
Sounds strange. Can you provide me with a repro case to look at? Just please don't post the project here in public. support at tasharen.com

memetic arts

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: Issue with TweenAlpha on ScrollView
« Reply #2 on: January 07, 2014, 12:07:51 PM »
Thanks, ArenMook.

Just sent an email with a repro case attached.  Really appreciate the help on this.

memetic arts

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: Issue with TweenAlpha on ScrollView [RESOLVED]
« Reply #3 on: January 09, 2014, 01:41:40 PM »
I'm marking this "Resolved", but not "Fixed" for now, as I was able to find a workable solution; posting for those who may find themselves with a similar issue.

It turns out that the solution was actually needed to resolve another issue, that being that buttons in windows that have been tweened/set to 0 Alpha are still active, and therefore can still be clicked even if they can't be seen.

The answer then: Initialize the widget (and its children) to Deactivated.   Then, before calling the TweenAlpha, Activate the widget and its children (recursively) just before toggling back to 1. Similarly, when dismissing the window, TweenAlpha to 0, then Deactivate recursively.

This doesn't really explain why the issue below was happening -- unless I missed something in the docs, you really shouldn't need to "Activate" for the ScrollView to catch the Tween, but apparently that is the case.

ArenMook, hope I saved you some time, at least for now!  (I've actually seen a few posts since mine with tweenAlpha / scrollview / grid issues . . . maybe related somehow?)

Cheers.

==rr


memetic arts
digital media publishing

http://www.memeticarts.com