In this recipe, you will learn how to add an outline to a Text (Script) component. In order to achieve this, you will have to learn how to use a UI Effect component of the new UI system of Unity, the Outline (Script) component. Similar to text shadows, text outlines can also add an element of boldness to text that is displayed on the screen. This can be useful when there are many elements on the screen, or even if you just want a certain text element to appear more dominant than others. There are many uses for text outlines, and they can be useful to experiment with in order to find out what suits your game the most.
First of all, we need to create a new UI text. In order to do this, right-click on the Hierarchy panel and then navigate to UI | Panel. Finally, name it Text with Outline.
After this, we can regulate all the parameters in the Inspector as we want. However, in order to be sure that we notice the nice effect, we can enlarge Text with Outline...