
上QQ阅读APP看书,第一时间看更新
How to do it...
To display a text message with sophisticated TextMeshPro visual styling, follow these steps:
- Create a new Unity 3D project.
- Add a new UI TextMeshPro Text GameObject in the scene – choose menu:
GameObject | UI | TextMeshPro – text. Name this GameObject Text-sophisticated.
TextMeshPro GameObjects do not have to be part of the UI Canvas. You can add a TextMeshPro GameObject to the Scene directly by choosing the Scene panel menu Create | 3D Object | TextMeshPro – text.
- Ensure that your new Text-sophisticated GameObject is selected in the Hierarchy panel. In the Inspector for the Rect Transform, click on the Anchor Presets square icon, hold down Shift + Alt, and click on the top and stretch rows.
- Ensure the following properties are set:
Font Settings:- Font Asset set to Anton SDF
- Material Preset set to Anton SDF - Outline
- Font size 200
- Alignment set to horizontal center
- Face:
- Color set to white
- Dilate set to 0
- Outline:
- Color set to Red
- Thickness set to 0.1
- Underlay (shadow):
- Offset X set to 1
- Offset Y set to -1
- Dilate set to 1
The following screenshot shows the Inspector panel with these settings:

- The Text-sophisticated GameObject will now appear as very large, with a white inner, red outline, and a drop shadow to the lower right.