Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Textmesh Pro component changing RectTransform values when added and general impressions

Discussion in 'Unity UI & TextMesh Pro' started by Nieles_GH, Jul 13, 2018.

  1. Nieles_GH

    Nieles_GH

    Joined:
    Jun 26, 2017
    Posts:
    14
    I'm currently in the process of replacing the standard Text components with the Text Mesh Pro ones and it's quite annoying that the Text Mesh Pro component changes the Rect Transform settings, this makes replacing the text components a lot more painstaking.
    Any specific reason for this?

    Some other impressions:

    Why is the default setting of Raycast Target true?
    I only want this to be true in 5% of the cases and from what I've heard it can be quite a heavy option.
    The default value of the standard Unity text raycast target was already true but in text mesh pro it's little more hidden away in the extra's options. Anyway, I would think false would be the most common use case so I would think this should be the default.

    Overall Text Mesh Pro is a cool package but I would think that if Unity adopts it in their engine they would integrate it a little better. Because even though it comes with the engine now it still feels like a separate package. If this happens more with other packages Unity will become quite messy over time.
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,772
    TextMesh Pro should not be changing the RectTransform settings. What version of Unity are you using? Can you provide more insight on how to reproduce this behavior?

    As you stated, this is enabled by default to mirror the behavior of UI.Text which also has Raycast Target enabled by default. I can certainly consider adding an options in the TMP Settings to control the default behavior of this option.

    Do you mean just from a visual standpoint? If so take a look at the 1.3.0-preview version of the TextMesh Pro package.
     
  3. Nieles_GH

    Nieles_GH

    Joined:
    Jun 26, 2017
    Posts:
    14
    I'm using Text Mesh Pro 1.2.4 in Unity 2018.2.
    It's happening every time I add the Text Mesh Pro UGUI component to a GameObject:


    And what I mean with that it feels like a different package comes from multiple things. It does indeed look a little different. But also that it's not part of the standard UnityEngine.UI namespace. And the naming to me is a little weird. TextMeshProUGUI just is a long name that I could expect from an asset store package but in the Unity engine, I would expect a shorter more straightforward name. Also how to add materials for texts with different outlines was a little unclear to me, it doesn't work as straightforward as adding an outline component to the gameobject.

    I do get where it's coming from and I also think it's good Unity works with the developers bring the great packages into Unity by default but then the package should also feel like something standard in Unity.
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,772
    The ability to control the default size of a RectTransform is a feature that was requested by users a long time ago. The default size can be defined in the TMP Settings for both the <TextMeshPro> component and for the <TextMeshProUGUI> component. I could add an option to disable this feature is needed.

    BTW: I already added the ability to control the Raycast Target in the TMP Settings.
    upload_2018-7-16_14-28-44.png

    In terms of the ability to dynamically change the visual appearance of the text to add an Outline, Shadow, Glow, etc. This functionality is made possible by the use of Signed Distance Field and are material properties which are manged via Material Presets. This provides for the best flexibility and performance. By contrast the Outline and Shadow component used in the UI is super inefficient as results in increasing the geometry count by 5x to 10x. It also looks horrible and will kill performance on mobile devices. See the following old post about this.

    As I continue to work / improve TextMesh Pro and work on the new text system (a.k.a. integrated version), that the product features and workflows (where it makes sense) mirror those of Unity. At the same time, I also had to be mindful of the hundreds of thousands of TMP users and make sure I provide as smooth as possible transition / migration to the new system.
     
  5. Nieles_GH

    Nieles_GH

    Joined:
    Jun 26, 2017
    Posts:
    14
    For the default size maybe it's an option to use the default size when creating a new gameobject with a Text Mesh Pro component from the new GameObject menu. But to not use it when adding the Text Mesh Component yourself?
    But maybe I only had issues now because I was replacing all Text components with the Text Mesh Pro ones.

    I didn't know about the TextMeshPro settings, looking forward for the raycast option :)
    Overall I'm very pleased with Text Mesh Pro and it does look a lot better than the standard Unity Text!
    So keep up the good work!
     
    Stephan_B likes this.