当前位置:网站首页>[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.
边栏推荐
- Four years of weight loss record
- 深度学习21天——卷积神经网络(CNN):天气识别(第5天)
- 无题四
- Excuse me if you want to write data in mysql, with flink - connector - JDBC directly is ok, but I'm in the f
- EU | Horizon 2020 ENSEMBLE: D2.13 SOTIF Safety Concept (Part 2)
- 2022.8.3
- leetcode: 529. 扫雷游戏
- How to realize the short press and long press detection of the button?
- How ali cloud storage database automatically to speed up the loading speed of www.cxsdkt.cn how to set up the case?
- 蚁剑webshell动态加密连接分析与实践
猜你喜欢
上海控安技术成果入选市经信委《2021年上海市网络安全产业创新攻关成果目录》
egg框架使用(一)
js 图形操作一(兼容pc、移动端实现 draggable属性 拖放效果)
如何实现按键的短按、长按检测?
CCVR eases heterogeneous federated learning based on classifier calibration
IDEA performs the Test operation, resulting in duplicate data when data is inserted
C语言的高级用法
Dry goods!Generative Model Evaluation and Diagnosis
dotnet OpenXML parsing PPT charts Getting started with area charts
seata源码解析:TM RM 客户端的初始化过程
随机推荐
Hundred lines of code launch red hearts, why programmers lose their girlfriends!
PAT乙级-B1020 月饼(25)
Assembly language (8) x86 inline assembly
EU | Horizon 2020 ENSEMBLE: D2.13 SOTIF Safety Concept (Part 2)
PAT乙级-B1019 数字黑洞(20)
Marketing Suggestions | You have an August marketing calendar to check! Suggest a collection!
无题九
无题一
PAT Grade B-B1020 Mooncake(25)
Two-table query average grouping in sql server
如何实现按键的短按、长按检测?
seata源码解析:事务状态及全局锁的存储
Bias lock/light lock/heavy lock lock is healthier. How is locking and unlocking accomplished?
汇编语言(8)x86内联汇编
There is only one switch, how to realize the nqa of master-slave automatic switching
上海控安技术成果入选市经信委《2021年上海市网络安全产业创新攻关成果目录》
5. Deploy the web project to the cloud server
19. Server-side session technology Session
tensorflow.keras无法引入layers
新白娘子传奇系列