Hi, I am using
Unity UI Prefab to customize my
Subtitle Menu. I am trying to make it looks like a speech bubble with an arrow pointing towards the speaking character.
I attempt to use GL.TRIANGLES (
https://docs.unity3d.com/ScriptReference/GL.TRIANGLES.html) to draw the arrow, but I don't know how to put a vertex above the speaking character. What code should I use to reference the speaking character position?
By the way, does AC subtitle menu automatically prevent different subtitles to overlap?
Thanks for your help.
Comments
If you check Duplicate for each line? in the Menu's properties then a new instance of the Menu will be made for each line. This allows for multiple to be shown at once - but overlapping etc will need to be handled through custom script.
Once checked, each Menu will be linked to its own Speech class instance, which you can access to get character information:
Speech speech = myMenu.speech;
Char speaker = speech.GetSpeakingCharacter ();
Since Menus are being duplicated, you'd need to use the PlayerMenus script's GetMenuWithCanvas method to get a reference to the Menu - but this method does not currently work for duplicated Menus. I shall look into this as part of the upcoming update.
hi.
how can i link my customize TextMeshPro to AC subtitle.
in other word i want Link this to AC subtitle:
https://github.com/mnarimani/RTLTMPro
i used of "Unity Ui In Scene" for "Source" subtitle menu and linked a unity ui text with a canvas to it and linked text ui to label element. and i wrote a script to put inside RTLTMPro every word that has inside unity text ui and attached it to text ui.
it works. but how can i directly linked the RTLTMPro to AC subtitle?
Welcome to the community, @NobaveDevelopers.
AC supports the "vanilla" TextMeshPro component - see the Manual's "Supported third-party assets" chapter. To enable this support, you just add "TextMeshProIsPresent" as a Scripting Define Symbol to your Player settings.
Once done, all elements in the AC Menu Manager will require TextMeshProUGUI components in place of Unity's own Text component.
Looking at the source code you've provided, the RTLTextMeshPro class appears to derive from TextMeshProUGUI - so this should still be picked up by the AC integration. Have you attempted this method?
very thanks for your answer..@ChrisIceBox
no i didn't try that solution. I knew it could be link the regular unity TMP to AC by add Scripting Define Symbol ، but I thought it couldn't be link RTLTMP to AC.
thank you again and i'm going to work on it.
If it doesn't work I'll come back. If it does, all my Persian writing problems will be resolved.
thanx.
hi @ChrisIceBox
it doesn't work. i mean the "Linked Text:" field of element , accepted RTLTMP.
but it doesn't display the text. not even with regular TMP.
when speech action list runs , it appear the RTLTMP but it doesn't display any text on it. i change every setting or font. i did whatever i can to do but it didn't work.
what's the problem?
If it's not working with regular TMP, then we should look at that first. It may be that resolving that issue also solves the one with RTLTMP.
Have your Subtitles UI prefab use a TextMeshProUGUI component in place of Text or RTLTMP, then link it to the Menu Manager in the usual way.
Make sure that text is able to display normally by giving the component some default text that is visible when editing the prefab.
If you run the game, what are the contents of the TextMeshProUGUI component? (Check the Inspector, not just how it appears in the Game window) Any relevant messages in the Console? Please share screenshots of all relevant aspects so that we can see exactly what your situation is. I will also need to know your AC and Unity version numbers.
Hi. i'm sorry for late. i wasn't in home for two days. I apologize. and I appreciate you for responding quickly and taking care of our problems.
just wait i will back soon.
hi @ChrisIceBox
it works with regular TMP but doesn't work with RTLTMP.
there is a weird issue. when i attach the TMP it works. then i attach RTLTMP after that. it doesn't work. but it put the text into TMP which i attached before.
this is with regular TMP.
https://ibb.co/wzDmrx0
this is with RTLTMP
https://ibb.co/5jzckBx
and this is strange issue.keep in mind i attached the RTLTMP in this image and AC has set the text into TMP. look at inspector.
https://ibb.co/RcWc36s
and i'm sorry for my bad English.
i forgot to say.
AC version: 1.66.2
Unity: 2019.2.2f1
AC links to Unity UI via Constant ID numbers. Both your TMP and RTLTMP objects have Constant ID values - seen by the "save" icon in their Hierarchy.
In the Menu Manager, what is the Label element's "Linked Constant ID" value? It will need to match that associated with the RTLTMP. This is done by dragging the RTLTMP GameObject into the "Linked Text" property field, and the Constant ID number will get updated automatically.
Make sure that both these components do not have the same Constant ID value - they should be unique.
You are also using a version of AC that is a fair bit older than your Unity version, so it would be wise to update after backing up your project.