当前位置:网站首页>[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.
边栏推荐
- How ali cloud storage database automatically to speed up the loading speed of www.cxsdkt.cn how to set up the case?
- dotnet OpenXML 解析 PPT 图表 面积图入门
- 21 Days of Deep Learning - Convolutional Neural Networks (CNN): Weather Recognition (Day 5)
- MySQL内部函数介绍
- What is the function of the regular expression replaceAll() method?
- 2022.8.3
- 正则表达式replaceAll()方法具有什么功能呢?
- QSS 选择器
- express hot-reload
- Hundred lines of code launch red hearts, why programmers lose their girlfriends!
猜你喜欢

Egg framework usage (1)

Weekly Report 2022-8-4

2022.8.3

周报2022-8-4

CCVR eases heterogeneous federated learning based on classifier calibration

dotnet OpenXML parsing PPT charts Getting started with area charts

IDEA performs the Test operation, resulting in duplicate data when data is inserted

轩辕实验室丨欧盟EVITA项目预研 第一章(四)

Why do I recommend using smart async?

【LeetCode】623. Add a row to the binary tree
随机推荐
并发之CAS
Pytorch深度学习快速入门教程 -- 土堆教程笔记(三)
营销建议 | 您有一份八月营销月历待查收! 建议收藏 !
js graphics operation one (compatible with pc, mobile terminal to achieve draggable attribute drag and drop effect)
为什么我推荐使用智能化async?
Voice conversion相关语音数据集综合汇总
Overall design and implementation of Kubernetes-based microservice project
无题三
tensorflow.keras无法引入layers
无题五
eKuiper Newsletter 2022-07|v1.6.0:Flow 编排 + 更好用的 SQL,轻松表达业务逻辑
【AGC】增长服务1-远程配置示例
MySQL内部函数介绍
Concurrent CAS
express hot-reload
无题七
What is CRM Decision Analysis Management?
QSS 选择器
Can MySQL use aggregate functions without GROUP BY?
轩辕实验室丨欧盟EVITA项目预研 第一章(四)