Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: nospam94 on May 15, 2013, 02:47:19 AM

Title: nested UITable and delegate function in UI'S
Post by: nospam94 on May 15, 2013, 02:47:19 AM
Hi,

i was playing with UITable (nested) and i manage to do the job (for nested) with propagation of repositionNow in uitables parent of the uitable that had it's var reposition now to true; it was quite simple so it could be add in next release.

Next, i was playing with Tweener and UIButtonTween (in quest log demo) and i wanted to change the sprite of the uiButtonTween when tween is finished. so i create a script and register a delegate for tween.onFinished but it didn't work because UIButtonTween do this :

  1. // Set the delegate
  2. tw.onFinished = onFinished;

I think i would be better if we put instead :
  1. // Set the delegate
  2. tw.onFinished += onFinished;

so we can have multiple receivers...
Title: Re: nested UITable and delegate function in UI'S
Post by: ArenMook on May 15, 2013, 11:47:52 AM
Can't do that as-is, as it will cause callbacks to be cumulative whether you want it or not.
Title: Re: nested UITable and delegate function in UI'S
Post by: nospam94 on May 17, 2013, 12:27:13 AM
Hi

I don't understand. if you have two UI that need to talk to a third common UI, you can't (or you shouldn't).
So one UI should tell second UI what third UI is expected to do. Or you need to rewrite all UIs if you want to avoid this ?

when using NGUI, i try to avoid modification of UI because file doesn't have versioning number so you have to use file comparator to see if it has been modified. Even readme.txt has bad version number...

in UIbuttonTween, onFinished is registered to the tween onFinished even if it's null (undefined) so i think it's hazardous
Title: Re: nested UITable and delegate function in UI'S
Post by: ArenMook on May 17, 2013, 01:29:20 AM
You need to follow NGUI's updating instructions from the readme file and it will always show the correct version.

Write a script to do multiple things if you need to do multiple things, and trigger this script's function.