Adding outlines to text

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.

How to do it...

  1. First of all, we need to create a new UI text. In order to do this, right-click on the Hierarchy ...

Get Unity UI Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.