playMaker

Author Topic: get text mesh pro total page count?  (Read 1275 times)

westingtyler

  • Full Member
  • ***
  • Posts: 221
    • View Profile
    • My Oculus Rift + Touch VR Game Using Playmaker
get text mesh pro total page count?
« on: August 07, 2018, 07:10:14 AM »
I didn't want to request an action yet since there maybe is a way to do this already, but if not, then this action would be great.

I just discovered how there is a text mesh pro setting of Page, and you can change the page number (and presumably use Set property to change the currently-viewed page.) This, combined with word wrap, COULD solve basically all my text displaying problems (well, I'd need the ability to change the color of individual words or get a typewriter effect to solve ALL my problems, but still).

Is there some way to check the text mesh pro game object's total pages, and do things based on that? I want to have a text display below a book page that says
Page 1/7 and change this string based on which page you are currently viewing, but I cannot do this without some way to check the maximum number of pages in the TextMeshPro based on its string.

How can we do that? Even if there is some way to check if a page is empty, that could be used to disallow further flipping through the pages.

westingtyler

  • Full Member
  • ***
  • Posts: 221
    • View Profile
    • My Oculus Rift + Touch VR Game Using Playmaker
Re: get text mesh pro total page count?
« Reply #1 on: August 13, 2018, 10:38:51 PM »
on this video
a comment by the textmesh pro creator gave some info that may help in creating this action:

"To answer your question, the TextMeshPro.textInfo class contains the pageCount which can be used to add your logic. If you have any additional questions about this simply post on the TextMeshPro user forum or email me."

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4214
    • View Profile
    • jinxtergames
Re: get text mesh pro total page count?
« Reply #2 on: August 15, 2018, 01:57:32 AM »
Hi,
Can you try the attachment below?

westingtyler

  • Full Member
  • ***
  • Posts: 221
    • View Profile
    • My Oculus Rift + Touch VR Game Using Playmaker
Re: get text mesh pro total page count?
« Reply #3 on: September 17, 2018, 07:05:45 PM »
Thanks. When I try to use the action, it tells me the game object needs a UGUI textmesh pro component, but it has a TextMeshPro (script) on it already. It seems there's a difference between what I use, a 3d textmesh pro object, and a ugui canvas object, which I do not use. Is there a way to make it work with the TextMeshPro script 3d game object since I don't use the Canvas stuff?

westingtyler

  • Full Member
  • ***
  • Posts: 221
    • View Profile
    • My Oculus Rift + Touch VR Game Using Playmaker
Re: get text mesh pro total page count?
« Reply #4 on: October 23, 2018, 09:23:58 AM »
bump. can anyone help with this, given my last post in the thread?