Forum rules - please read before posting.

TextMesh Pro Support

edited December 2016 in Engine development
Hey there!

In addition to Super TextMesh support I'm looking into with the dev and via the other thread, thought I would see how support with TextMesh Pro Support might shake out.

I wrote the dev and asked him if TMP could:

a.) Pull from AC the way that STM does with the script in the wiki, and
b.) Utilize and honour AC Speech Tokens in a way that is currently problematic with STM.

The dev there got back to me with some thoughts that I'll share with you, Chris, in case you'd like to consider adding support for TMP to AC:

---

I am pretty sure the author of Adventure Creator could easily add support for TMP.

Integration could be as simple as replacing the UI.Text type to TMP_Text. If the typewriter FX is done using string operations where the code looks for the [wait] tag that could also work easily by just mostly replacing the type.

---

Not sure if it is as straightforward as he says, but hopefully that helps if it does! Let me know if I can do any more legwork to assist.

Comments

  • I'll consider it.
  • Me too, big fan of text mesh pro
  • Well, the developor is of course right when he says it's a case of replacing the component name - but of course it's not really that simple.  For every references AC makes to Text, it would also have to make one for TMPro, which means doubling the number of variables - and then again were any other such asset support be requested, such as Super Text Mesh.

    It's not ideal from a memory management perspective, and my feeling when it comes to other assets is really that it's much better to empower users with the ability to easily link AC with the asset of their choice.  Is attaching a script that copies the values of an out-of-view Unity Text box to a visible TMPro component overly cumbersome?
  • For me personally yes indeed.. I see text mesh pro as the go to teXT ui, however it's dependant on how many other AC people use it

    If there are more it would be quite nice to have it come with AC...

    Thanks
  • Hey Chris,

    Attaching a script as you suggest would not be a problematic approach for me - I just don't know how to create such a script. :)

    In the WYSIWYG, programming-free spirit of AC, maybe the way to go would be to just create a gang of these types of scripts that would allow AC users to take this approach with a variety of the most popular Unity extensions? TMP and STM both probably being good candidates.

    For my purposes, the predominantly important thing would be that this script would allow these other assets to correctly interpret and deal with AC speech tokens. For me, and probably others, that would be a dealbreaker.
  • Wow, that asset looks really nice. Kinda expensive though, lol.
  • If you're transferring the contents of a Text box to a TMPro one, the speech tokens will have already been converted - so that's not a problem.  An example script is a good suggestion though - probably one for the wiki.
  • Yes! Precisely. Would love to see the wiki full of useful scripts like that!

    Wish I could produce some myself, but I cannot. :(

    Hmm, that gives me an idea for another thread...
  • Thank you,

    I'll be making use of this in the near future.
  • I've now implemented this and can confirm it is working perfectly!

    Thanks very much, Chris. This is great!
  • In case you want to avoid using that setup. We use this:
    https://www.assetstore.unity3d.com/en/#!/content/52508

    I don't know whether it has all the effects you need, but since this one alters unity UI text field, it works out of the box for me when I use the unity UI menu systems.
  • Thanks Teshla! I think I'm sorted on this, but I'll have a look. :)
  • edited July 2018
    Hi @ChrisIceBox, I've just tried the integration script you provided, but I'm having an issue with it.

    I've just replaced my AC subtitles menu with an Unity UI one (using the "when speech plays" Appear Type). The "Text" object is displayed and updated perfectly when speech plays, but the "TextMeshPro Text" object takes a split of second longer to do so. So when a new subtitle appears on the screen, it shows the previously used text really quickly before the correct one is copied over.

    Is there any way to avoid this?

  • Try checking Duplicate for each line? in the Menu's properties box - it'll create a new instance of the UI for each line, so there won't be any previously-used text to show.
  • edited July 2018
    Thanks! I was using "Unity UI in Scene" instead of a prefab, so when I checked "Duplicate for each line?", the subtitles stopped showing altogether. I made a prefab and changed the source to it, and the subs started appearing again, but now I have a different problem:


    For a split of second, the text elements are drawn in their original position in the screen, and only then are they moved to the position above the speaking character. Is this a bug or have I done anything wrong in the settings?


  • My current workaround for this is to have a custom animation transition type to make the first 0.1s invisible.
  • Let's see your Menu's full properties as they appear in the Menu Manager.  If you remove any custom scripts from the Canvas prefab, does it then work?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.