Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TextMesh Pro [Solved] page tag causes inaccurate pageCount?

Discussion in 'UGUI & TextMesh Pro' started by Gordon_G, Jan 15, 2021.

  1. Gordon_G

    Gordon_G

    Joined:
    Jun 4, 2013
    Posts:
    372
    [Edit] Actually, I don't think this had anything to do with the page tag. The issue seems to be that I was enabling the parent canvas of TMP_Pro text field in the same frame I was adding the text. Calling ForceMeshUpdate(true); resolved the issue.

    I have a piece of text in a textmesh pro field with overflow set to Page. I have forward and back buttons that work nicely, using pageToDisplay. In a sample bit of text there is enough text to fill 2 pages.

    However, if I slip a page tag into the first paragraph of page 1 in the sample text, there should conceptually be 3 pages. But page count still returns 2 pages.

    the TMP_Text field breaks first page up on the page tag, but doesn't seem to recognize that what was before page 2 without that tag, page 2 now long enough to fill two pages on its own. Hence, the paging should see a total of 3 pages, but does not. Consequently, I cannot page through the entire text.

    This does not seem right - is there a way to get this to work? Note that I am adding the text to the field dynamically, if that makes a difference...
     
    Last edited: Jan 15, 2021