当前位置:网站首页>[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.
边栏推荐
- Voice conversion相关语音数据集综合汇总
- 百行代码发射红心,程序员何愁命不中女朋友!
- PAT Class B-B1019 Digital Black Hole (20)
- my journal link
- 开源一夏|OpenHarmony如何查询设备类型(eTS)
- What is CRM Decision Analysis Management?
- PAT乙级-B1019 数字黑洞(20)
- Qiu Jun, CEO of Eggplant Technology: Focus on users and make products that users really need
- 21 Days of Deep Learning - Convolutional Neural Networks (CNN): Weather Recognition (Day 5)
- How ali cloud storage database automatically to speed up the loading speed of www.cxsdkt.cn how to set up the case?
猜你喜欢

基于 Kubernetes 的微服务项目整体设计与实现

皕杰报表的下拉框联动

shell脚本实例

Bias lock/light lock/heavy lock lock is healthier. How is locking and unlocking accomplished?

Creo 9.0 基准特征:基准坐标系

seata源码解析:事务状态及全局锁的存储

dotnet OpenXML parsing PPT charts Getting started with area charts

Oracle temporary table space role

七夕浪漫约会不加班,RPA机器人帮你搞定工作

【LeetCode】623. Add a row to the binary tree
随机推荐
Wei Dongshan Digital Photo Frame Project Learning (6) Transplantation of tslib
无题十一
无题十三
Imitation SBUS fixed with serial data conversion
2022.8.3
自定义过滤器和拦截器实现ThreadLocal线程封闭
There is only one switch, how to realize the nqa of master-slave automatic switching
周报2022-8-4
What is the function of the regular expression replaceAll() method?
CPU的亲缘性affinity
韦东山 数码相框 项目学习(六)tslib的移植
放大器OPA855的噪声计算实例
The Seven Weapons of Programmers
js graphics operation one (compatible with pc, mobile terminal to achieve draggable attribute drag and drop effect)
Science bosses say | Hong Kong rhubarb KaiBin teacher take you unlock the relationship between the matrix and 6 g
2022-08-01 Review the basic binary tree and operations
Overall design and implementation of Kubernetes-based microservice project
Pycharm 常用外部工具
Can MySQL use aggregate functions without GROUP BY?
Creo 9.0 基准特征:基准轴