So now that we have a good idea of how the Canvas works, let's try adding our own elements into the game. We'll start with a very simple label. A label is simply static text that you use on the User Interface. Let's have our label say Use the arrow keys to move.
因此,既然我们对Canvas的工作原理有了一个很好的了解,让我们尝试将自己的元素添加到游戏中。 我们将从一个非常简单的标签开始。 标签只是您在用户界面上使用的静态文本。 让我们让标签说“ 使用箭头键移动” 。
First off, to add any UI element, we now know that we need a Canvas first. However, Unity saves us the trouble of inserting a new Canvas into the scene, by doing it automatically when you create a UI element in a scene that doesn't already have a Canvas.
首先,要添加任何UI元素,我们现在知道首先需要Canvas 。 但是,当您在尚无Canvas的场景中创建UI元素时,通过自动执行操作,Unity避免了将新Canvas插入场景的麻烦。
To add a label into the scene, right click in the Hierarchy and select UI Elements → Text.
要将标签添加到场景中,请在“ 层次结构”中单击鼠标右键,然后选择“ UI元素”→“文本” 。
![Adding UI Elements to canvas Unity 3D](https://i-blog.csdnimg.cn/blog_migrate/627b1ae793b89a1918cfc382fe64d62e.png)
As soon as you click on Text, you'll notice a new addition in your Hierarchy view.
一旦单击“ 文本” ,您就会在“ 层次结构”视图中注意到一个新的添加。