In this recipe, you will learn how to add a shadow to a Text (Script) component. In order to achieve this, you will learn how to use a UI Effect component of the new UI system of Unity — the Shadow (Script) component. This kind of effect can add a dramatic touch to text and, as a result, make it stand out among other elements that may be in the UI. In addition to this, when there are many elements in the background, it is possible that a piece of text may seem lost. As such, adding a shadow to the text can also improve its legibility.
First of all, we need to create a new UI text. To do this, right-click on the Hierarchy panel and then navigate to UI | Panel. Finally, rename it Text with Shadow.
Then, we can regulate all the parameters in the Inspector as we want. However, in order to make sure that we notice the nice effect, we can enlarge Text with Shadow with Rect tool (which can be used quickly with the T hotkey), increase the Font Size variable to...