Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: westingtyler on August 07, 2018, 10:10:14 AM

Title: get text mesh pro total page count?
Post by: westingtyler on August 07, 2018, 10: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.
Title: Re: get text mesh pro total page count?
Post by: westingtyler on August 14, 2018, 01:38:51 AM
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."
Title: Re: get text mesh pro total page count?
Post by: djaydino on August 15, 2018, 04:57:32 AM
Hi,
Can you try the attachment below?
Title: Re: get text mesh pro total page count?
Post by: westingtyler on September 17, 2018, 10: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?
Title: Re: get text mesh pro total page count?
Post by: westingtyler on October 23, 2018, 12:23:58 PM
bump. can anyone help with this, given my last post in the thread?