Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - [ELine]asilva

Pages: [1]
1
NGUI 3 Support / Re: Manually Using TweenAlpha Screws Up Button Tweens
« on: April 18, 2014, 03:04:44 PM »
Sorry for the slow response on this - been crunching quite a bit lately.

Putting the GetComponents inside the if check is fine, but using group 0 for the "automatic" tweens used by UIButton seems bad to me since whenever I add a new tween to an object its default tween group is 0 (which would mean any that you add will be overwritten by the UIButton tween unless you change the group every time you add one). Also, think of all the users out there that already have tweens attached to their objects and haven't changed the group from the default of 0 - all of their tweens would be broken - that's why I recommended -1 - it's an int, so -1 is not illegal or anything and it has a much lower likelihood of being already in use by current users.

Thoughts?

2
NGUI 3 Support / Re: Manually Using TweenAlpha Screws Up Button Tweens
« on: March 07, 2014, 12:31:20 PM »
In theory, they should never play at the same time (although I'll grant you that they obviously could).  Our use case is the artists/designers setup the tween(s) they want to play with specific parameters, etc. with each one on a different group (mostly, there are 2 groups; one for tweening in and one for tweening out - we were seeing issues with playing them in reverse - not resetting properly, etc. - could have been something we did wrong).  Then they use uscript (our visual scripting system of choice) to kick off whichever tween group they want to play on which object(s).

Like I said, I'll grant you that having multiple tweens could conflict with each other, but that seems like a developer-solvable problem, whereas UIButton overwriting manually added tweens isn't (without the code above).  Also, the problem of having multiple tweens on a single object already exists and developers are already responsible for mitigating this issue.

3
NGUI 3 Support / Re: Manually Using TweenAlpha Screws Up Button Tweens
« on: March 06, 2014, 12:37:27 PM »
ArenMook, one thing that it seems as though still isn't answered from this thread is that if I have a UIButton and a manually added tween attached to an object, when the Hover/Click/etc. tweens happen from the UIButton, the UITweener.Begin<> function looks for a tween that is already attached to the game object to use, instead of creating a new one.  This makes sense if all you have is a UIButton attached, but if you've manually setup specific tweens to happen at different times (using different group numbers) the first of those will get overwritten by the code in UITweener.Begin<>.

One way to solve this is to reserve a special tween group for tweens that are created by UITweener.Begin<>.  I have made those changes locally (using the special tween group of -1) - I was wondering if you might consider pulling this into your codebase so we don't have to redo it every time we get up to date?

(FYI, the differences are before the #if where we look for components with the reserved tween group and the line towards the bottom where we set the tweenGroup for the starting tween to the reserved group of -1)

  1. static public T Begin<T> (GameObject go, float duration) where T : UITweener
  2. {
  3.         T comp = null;
  4.         T[] comps = go.GetComponents<T>();
  5.        
  6.         foreach (T tweener in comps)
  7.         {
  8.                 if ( tweener.tweenGroup == -1 )
  9.                 {
  10.                         comp = tweener;
  11.                         break;
  12.                 }
  13.         }
  14. #if UNITY_FLASH
  15.         if ((object)comp == null) comp = (T)go.AddComponent<T>();
  16. #else
  17.         if (comp == null) comp = go.AddComponent<T>();
  18. #endif
  19.         comp.mStarted = false;
  20.         comp.duration = duration;
  21.         comp.mFactor = 0f;
  22.         comp.mAmountPerDelta = Mathf.Abs(comp.mAmountPerDelta);
  23.         comp.style = Style.Once;
  24.         comp.animationCurve = new AnimationCurve(new Keyframe(0f, 0f, 0f, 1f), new Keyframe(1f, 1f, 1f, 0f));
  25.         comp.eventReceiver = null;
  26.         comp.callWhenFinished = null;
  27.         comp.enabled = true;
  28.         comp.tweenGroup = -1;
  29.        
  30.         if (duration <= 0f)
  31.         {
  32.                 comp.Sample(1f, true);
  33.                 comp.enabled = false;
  34.         }
  35.         return comp;
  36. }

Thanks for your time!

4
NGUI 3 Support / Re: Rendering text on a path
« on: February 05, 2014, 03:18:36 PM »
Thanks for the quick response! 

That should get me started.  I will post back here if I run into any issues.

5
NGUI 3 Support / Rendering text on a path
« on: February 05, 2014, 03:02:59 PM »
Hello and thanks for this awesome GUI package!

I have a couple questions regarding rendering text on a path (specifically in an arc).

1. What would be the best way to go about this using NGUI?
2. The algorithm posted in the answer on this page renders the text one character at a time and places/rotates the characters as it goes: http://stackoverflow.com/questions/2803853/how-to-create-curved-text-on-a-bitmap - would this be feasible with NGUI using the built-in text rendering tech?
3. The text geometry would be static once it's been rendered.  Would there be any way to pre-build that geometry with NGUI in the editor and then have it baked out to a mesh when the game is being built?  There will be a lot of it possibly on screen at once - 300-400 strings with an avg. 2-4 words per string when zoomed out.

Any info about where to start or how to accomplish something like this with NGUI would be much appreciated!

Thanks!
-Anthony

Pages: [1]