Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Performance of Rich Text on iOS

Discussion in 'UGUI & TextMesh Pro' started by casimps1, Jan 23, 2015.

  1. casimps1

    casimps1

    Joined:
    Jul 28, 2012
    Posts:
    254
    I have an app that I'm building and it's mostly composed of v4.6 UI components. I'm currently attempting to port it to iOS, and things have been going well with one exception.

    I have one particular Text component in a ScrollRect with a very large block of text in it (it's a Credits screen). When I click to view the Credits screen on my iPhone 4, the app freezes for a few seconds and then the text appears. After that initial delay the app is once again fairly responsive. It only seems to be a problem the very first time the Text is activated (i.e. - I can leave the screen, come back, and it doesn't freeze the second time). That leads me to think that some kind of allocation is causing that hiccup (although I don't see that problem on other platforms). I do notice that the Tri count jumps from about 500 to about 4000 when the Text is activated. Maybe it's all those tris being created?

    Another interesting note, the Mask attached to the ScrollRect seems to stop functioning after the Text is activated. I can still scroll the text normally, but it is no longer masked at all. Not sure if this is related to the large amount of text yet or not (will try that soon).

    Any ideas what's going on with this? Bug? Expected behavior? Is there a workaround or better way to handle this type of thing? It seems like a fairly common thing to do.
     
  2. DanielQuick

    DanielQuick

    Joined:
    Dec 31, 2010
    Posts:
    3,137
  3. casimps1

    casimps1

    Joined:
    Jul 28, 2012
    Posts:
    254
    Interesting... I'll have to see if that makes a difference. My instinct tells me no because there's a fair bit of text on screen widgets before that particular piece of Text is activated. So, I feel like most of the glyphs are already loaded by that point. But I'll try anyway.
     
  4. casimps1

    casimps1

    Joined:
    Jul 28, 2012
    Posts:
    254
    OK, so some interesting new info:

    I tried putting a short string of "ABCDEFG..." (w/ all the glyphs in there) and there was no freeze.

    I tried a long string of hundreds of A's spread across dozens of lines (so only a single glyph needed) and there was also no freeze.

    So, I guess it's not the glyphs or the sheer amount of text that's the problem. Maybe there's something about the particular text I'm using. Maybe the rich text tags?

    Interestingly, even though it didn't freeze the Mask still failed. So that seems to be a separate unrelated issue.
     
  5. casimps1

    casimps1

    Joined:
    Jul 28, 2012
    Posts:
    254
    Last edited: Jan 23, 2015
    alvaro-em likes this.