Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: chanhpomme on May 22, 2015, 01:28:27 PM

Title: TypeWriterEffect bugs
Post by: chanhpomme on May 22, 2015, 01:28:27 PM
Hi,

I'm actually having two different bugs with the TypeWriterEffect script:

- If a UILabel.text ends with a color or another encoding tag (for example "How you doing [FF0000]dude ?[-]"), the OnFinished callbacks from the TypeWriterEffect won't be called. Adding any other character after "[-]" fix this issue, but that's kind of dirty.

- Having keepFullDimensions to true, and some encoding tags in a UILabel (color, bold, etc...) can mess up the UILabel final display. It could untimely insert \n.
For example, let's say I have this text ("Hi, my name is chanhpomme, nice to meet you ngui fellows").
If I display it in a UILabel with a TypeWriterEffect, it would be finally displayed like so :

  1. Hi, my name is chanhpomme,
  2. nice to meet you ngui fellows
  3.  

But if I add some colors to this same text ("Hi, my name is [FF00FF]chanhpomme[-], nice to meet you ngui fellows"),
and display it in a UILabel with a TypeWriterEffect, it would be finally displayed like so (but "chanhpomme" would be colored) :

  1. Hi, my name is
  2. chanhpomme, nice to meet you ngui fellows
  3.  

I'm working on fixing these bugs myself, but does anybody have already seen these bugs and have some fixes ?

Thanks.
Title: Re: TypeWriterEffect bugs
Post by: chanhpomme on May 29, 2015, 09:54:03 AM
Anybody ?
Title: Re: TypeWriterEffect bugs
Post by: ArenMook on June 01, 2015, 08:22:12 PM
I will look into it and fix it, thanks!

Edit: Fix for #1 is to change line 254 of TypewriterEffect from:
  1. else if (mCurrentOffset == mFullText.Length)
to:
  1. else if (mCurrentOffset >= mFullText.Length)

I don't understand #2 -- it's working as expected for me. With "keep full dimensions" turned on the label keeps the full dimensions as it types.
Title: Re: TypeWriterEffect bugs
Post by: chanhpomme on June 03, 2015, 07:02:11 AM
Thanks for the answer !

The example for #2 is certainly not a good example. The sentence that I used as an example just came to my mind, and I don't even know if it does the bug. I'll try to find a working example, with the right sentence, and the right label properties (font used, size, etc.). For the moment, I can't reproduce the bug because we change some texts in our game, and I can't find a setup that cause the bug to happen. When it comes back, I'll update this thread.

Thanks again.