I have a ScrollRect component with the Rect Mask 2d component which together creates a mask around the corners. I was using the basic UI Text component and as default it has the Maskable option and is enabled by default.
This was I could get the text component to respect the mask from the Rect Mask 2D and the result is fine like this:
Recently I decide to move all my texts to TextMesh Pro and today I realized that it is not masking the text. I couldn’t find any option that worked so I could have the same behaviour as default UI Text
I found a mask option under a mobile shader, but I don’t think this is the way to achieve the effect I am hoping for.
Am I missing something? Any help on this would be great.
UPDATE:
I did a test with a gameobject with Rect Mask 2D and 2 gameobjects inside it… a default UI Text and a TextMesh Pro UI (Text). I used the standard font assent from textmesh pro and it does not receive the mask from the Rect Mask 2D.
UPDATE AGAIN:
Unity version: 2020.3.8f1
TextMesh Pro version: 3.0.6
The case that you referenced above was related to the softness control of the RectMask 2D. That specific issue was resolved in version 3.2.0-pre.2 of the TMP package. The latest preview release is version 3.2.0-pre.3.
In order for the masking to work with the RectMask 2D, you don’t have to switch shaders. You should be using either the mobile SDF shader or the full distance field shader. No need to switch to the masking shader which provides for the ability to use a masking shape / texture which can be animated. See example 19 - Masking Texture & Soft Mask included in the TMP Examples & Extras.
I would suggest updating to version 3.2.0-pre.3 and let me know if the issue still occurs. If it does, please provide me with a simply scene to look at for testing. I just tested on my end and everything appears to work as expected so something about your setup is likely causing the behavior you are seeing. I just need to reproduce that setup.
Thank you for the clarification and the support. I’ve been back in forth with TextMesh Pro and as I’m about to release the game on production and as it’s not recommended to use an alpha release for this cenario, I will skip this asset for this project for now.
What is in preview are the new features being introduced but the core functionality is deemed stable. These previews also include the bug fixes reported in preview releases which includes the verified releases.
I personally consider 3.2.0-pre 3 more stable than version 3.0.6 with respect to the core functionality. New features like Dynamic OS font assets are what is in preview for instance.
Hello, so on that project I dodge TextMesh Pro, but in a new project I have decided to use it on a new Unity version, 2021.2.0f1 to deal with the same problem from this thread, the transparency related to Rect 2D not been acting properly. After trying to see the pre-packages without luck I found a post from you @Stephan_B ( TextMesh Pro Open Source Repository? ) and I have edited the line on manifest, so now I have “com.unity.textmeshpro”: “3.2.0-pre.3”, but as soon it finishes the import all my texts changed to this
I tried to recreate the font asset and still the same. Any clues? Thanks.
I was in the same situation as you at first, and then I imported the missing basic resources through Window→TextMeshPro→Import TMP Essential Resources and it was normal.