Author Topic: [Resolved] UILabel and frame perfect refresh  (Read 2365 times)

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
[Resolved] UILabel and frame perfect refresh
« on: October 13, 2014, 08:03:03 PM »
Hi guys !
I'm currently making a dialog system and I have something kinda weird happening with NGUI and my dialog box.
I'm refreshing the text letter by letter on time, and my UILabel is set to SrinkContent, so it automatically goes to the next line if the text is not fitting into the current line. When this is happening there is one frame between the moment when the new text is displayed and when the text is shrunk, you can really easily see it. How can I fix that? thanks !

PS: Maybe it's fixed on most recent versions, I'm still using an old one (3.5.6). Maybe I can apply those changes to my version as I don't want right now to update to the latest.
« Last Edit: October 14, 2014, 08:19:15 PM by cayou »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel and frame perfect refresh
« Reply #1 on: October 14, 2014, 01:56:55 PM »
Refreshing text letter by letter? Have you seen the TypewriterEffect script that comes with NGUI?

I'm not sure about 356, it's very old though.

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: UILabel and frame perfect refresh
« Reply #2 on: October 14, 2014, 06:07:54 PM »
I'll take a look, maybe a video might be help what's going on right now, but I guess there is one frame between the moment when the text is displayed and when the UILabel decides to move the latest word to the next line.

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: UILabel and frame perfect refresh
« Reply #3 on: October 14, 2014, 06:26:00 PM »
Ok I think I got it. In your example you get first the text formatted from the UILabel, which is adding \n on lines before the text gets too long to fit into the line. I'm not doing that so when I display letter after letter the word is most of the time not completed when it goes to the next line.
Example:

"Bacon ipsum dolor sit amet pork chop pork loin tail fatback pig porch"

And then:

"Bacon ipsum dolor sit amet pork chop pork loin tail fatback pig
porche"

Which visually is not "elegant". I'll try to use the processedText from UILabel as input.