Author Topic: TypeWriterEffect bugs  (Read 4135 times)

chanhpomme

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
TypeWriterEffect bugs
« 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.
« Last Edit: May 29, 2015, 09:55:30 AM by chanhpomme »

chanhpomme

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: TypeWriterEffect bugs
« Reply #1 on: May 29, 2015, 09:54:03 AM »
Anybody ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TypeWriterEffect bugs
« Reply #2 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.
« Last Edit: June 01, 2015, 08:27:48 PM by ArenMook »

chanhpomme

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: TypeWriterEffect bugs
« Reply #3 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.