当前位置:网站首页>[Unity] [UGUI] [Display text on the screen]
[Unity] [UGUI] [Display text on the screen]
2022-08-05 09:44:00 【AX0101_4413】
Display text
The first step is to create a new Unity project.
The second step is to find the [Hierarchy] column.(usually at the top left of the screen, there is a [MainCamera])
The third step, right-click in the blank area of the [Hierarchy] column, select [UI] [Text], and click.
At this point, run the game (click the triangle at the top of the screen), and the word [New Text] should appear on the screen.End the run (click the triangle again).
Modify text
The fourth step is to find the [Inspector] column.(usually on the right side of the screen)
Step 5: Find [Text] in the [Hierarchy] column and click.At this time, the content of the [Inspector] column should change.
The sixth step, find [New Text] in the [Inspector] column, and modify it to any text you want to display.
At this point, run the game and your modified text should appear on the screen.End the run.
Code creates text
In step three, three objects should appear.Delete them at this time.(select them, press delete on keyboard)
The seventh step, download VS, search for [How to associate VS with Unity], and then associate VS with Unity.
The eighth step, search for [How to create and use scripts in Unity] [How to create game objects with code in Unity] [How to add components to game objects with code in Unity] [How to modify component properties with code in Unity].
In the ninth step, the things in the [Hierarchy] column are game objects. After clicking an object, the things in the [Hierarchy] column are the components of the object, and the previous [New Text] is the component parameters.Based on the search results of the eighth step, use the code to create the three objects that appear in the third step, and adjust the components and parameters to be exactly the same.
At this point, use this script (from step 8), run the game, and text will appear on the screen.
Extension: UGUI
In the third step, in addition to [Text] under [UI], there are many other options, including buttons, pictures, scroll bars.These are collectively called UI, also called UGUI.
边栏推荐
- leetcode refers to Offer 10- II. Frog jumping steps
- 线程之Happens-before规则
- MySQL内部函数介绍
- hcip BGP enhancement experiment
- js 图形操作一(兼容pc、移动端实现 draggable属性 拖放效果)
- 皕杰报表的下拉框联动
- CCVR基于分类器校准缓解异构联邦学习
- tensorflow.keras无法引入layers
- 新白娘子传奇系列
- IO stream articles -- based on io stream to realize folder copy (copy subfolders and files in subfolders) full of dry goods
猜你喜欢
随机推荐
链表中的数字相加----链表专题
仿SBUS与串口数据固定转换
Qiu Jun, CEO of Eggplant Technology: Focus on users and make products that users really need
leetcode refers to Offer 10- II. Frog jumping steps
皕杰报表的下拉框联动
Voice conversion相关语音数据集综合汇总
Pycharm 常用外部工具
为什么sys_class 里显示的很多表的 RELTABLESPACE 值为 0 ?
开源一夏|OpenHarmony如何查询设备类型(eTS)
Bias lock/light lock/heavy lock lock is healthier. How is locking and unlocking accomplished?
深度学习21天——卷积神经网络(CNN):服装图像分类(第3天)
ECCV 2022 Oral 视频实例分割新SOTA:SeqFormer&IDOL及CVPR 2022 视频实例分割竞赛冠军方案...
微服务 技术栈
Science bosses say | Hong Kong rhubarb KaiBin teacher take you unlock the relationship between the matrix and 6 g
无题九
【LeetCode】623. Add a row to the binary tree
Wei Dongshan Digital Photo Frame Project Learning (6) Transplantation of tslib
openpyxl to manipulate Excel files
There is only one switch, how to realize the nqa of master-slave automatic switching
matcher中find,matches,lookingAt匹配字符串的不同之处说明