JRPG template with Text Mesh Pro

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fanaei
Posts: 73
Joined: Wed Aug 15, 2018 10:38 am

JRPG template with Text Mesh Pro

Post by fanaei »

Hi Tony,
I'm trying to Use TextMeshPro on JRPG template. But the response buttons don't work.
I tried to check your sample scene for TextMeshPro, but it uses different template.
Can you make a prefab for JRPG template, too?
Or at least put some guide or screenshot of inspector to understand how to set it up.

Thanks
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: JRPG template with Text Mesh Pro

Post by Tony Li »

Hi,

Are you using the Dialogue System for Unity 2.x or 1.x?

If you're using 2.x, I recommend using the Standard Dialogue UI. (You don't need to import the TextMesh Pro Support package. It's only included for legacy developers whose projects are already using it.)

Follow these instructions to enable TextMesh Pro support.

If you add the JRPG template to the scene (in a Canvas), the Standard Dialogue UI, Standard UI Subtitle Panel, or Standard UI Menu Panel fields will look like this:

Image

Unassign the field. The field will change into this:

Image

Then you can remove the UI Text component from the NPC Subtitle Text GameObject, add a TextMeshProUGUI, and assign it to the field.
fanaei
Posts: 73
Joined: Wed Aug 15, 2018 10:38 am

Re: JRPG template with Text Mesh Pro

Post by fanaei »

Oh my god! I tried to change everything based on this page:
http://www.pixelcrushers.com/dialogue_s ... h_pro.html
You should have said there that's these things are unnecessary :(
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: JRPG template with Text Mesh Pro

Post by Tony Li »

I'm sorry for the trouble. That's the manual for version 1.x. Are you using version 1.x or 2.x?

If you've already used the version 1.x-style TextMeshProDialogueUI, we can just figure out why the response buttons aren't working if you prefer. If you want to do this, please tell me in what way the response buttons don't work. Can you not click them? Or is the text not showing up on them?
fanaei
Posts: 73
Joined: Wed Aug 15, 2018 10:38 am

Re: JRPG template with Text Mesh Pro

Post by fanaei »

How can I know that what version I'm using? I bought the asset about 1 month ago, So I think it's the newest.
Also I'm using these codes for RTL fixing:
https://github.com/sorencoder/RTLTMPro/ ... /README.md
Before this, I was using unity UI + i2 localization for fixing RTL problem. But TextMeshPro+ that Github code is more felexible.
The problem is that if I change this line in the code TextMeshProSubtitleControls.cs:

Code: Select all

public TMPro.TextMeshProUGUI line;
with:

Code: Select all

public RTLTMPro.RTLTextMeshPro line;
The RTL text will be fine, because:
tmp1.jpg
tmp1.jpg (40.54 KiB) Viewed 2019 times
But I can't add it to StandardBarkUI.cs
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: JRPG template with Text Mesh Pro

Post by Tony Li »

Hi,

RTLTextMeshPro is a subclass of TextMeshProUGUI. Why do you need to change "public TMPPro.TextMeshProUGUI" to "public RTLTMPPro.RTLTextMeshPro"? You should be able to assign an RTLTextMeshPro component to it anyway.

However, if you want to change all of the Standard UIs (including StandardBarkUI), edit UITextField.cs. Change TMPPro.TextMeshProUGUI to RTLTMPPro.RTLTextMeshPro. All of the Standard UIs use UITextField, so this will make them all use RTLTextMeshPro. I still don't think you need to do this, though, because RTLTextMeshPro is a subclass.

If I misunderstood you, I apologize. If this is the case, would you please provide some more details to help me understand?
fanaei
Posts: 73
Joined: Wed Aug 15, 2018 10:38 am

Re: JRPG template with Text Mesh Pro

Post by fanaei »

If I assign an RTLTextMeshPro component to it, as I showed on the picture below, the input text goes to the second field and doesn't get fixed well. But if I change "public TMPPro.TextMeshProUGUI" to "public RTLTMPPro.RTLTextMeshPro" the input text goes to the first field (RTL TEXT INPUT BOX) and everything will be fine.
tmp1.jpg
tmp1.jpg (40.54 KiB) Viewed 2016 times
I tried to edit UITextField.cs. and Changed TMPPro.TextMeshProUGUI to RTLTMPPro.RTLTextMeshPro, But got this error:

Code: Select all

Assets/Plugins/Pixel Crushers/Common/Scripts/UI/UITextField.cs(30,11): error CS0246: The type or namespace name `RTLTMPro' could not be found. Are you missing an assembly reference?
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: JRPG template with Text Mesh Pro

Post by Tony Li »

Hi,

Files in the Plugins folder, such as UITextField.cs, are compiled first. Since RTLTMPro is outside the Plugins folder, UITextField can't access it. I think the quick solution would be to move the RTLTMPro folder into the Plugins folder.

A more formal solution would be to make a subclass of StandardUISubtitlePanel, etc., and override the SetContent() method. then use the subclasses in your UIs. This way you won't lose any changes if you import a Dialogue System update.
fanaei
Posts: 73
Joined: Wed Aug 15, 2018 10:38 am

Re: JRPG template with Text Mesh Pro

Post by fanaei »

Thank you Tony. Moving folder fixed the problem.
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: JRPG template with Text Mesh Pro

Post by Tony Li »

You're welcome. I'm glad that fixed it.
Post Reply