当前位置:网站首页>[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.
边栏推荐
- 自定义过滤器和拦截器实现ThreadLocal线程封闭
- IDEA performs the Test operation, resulting in duplicate data when data is inserted
- 手写柯里化 - toString 理解
- leetcode 剑指 Offer 10- II. 青蛙跳台阶问题
- 营销建议 | 您有一份八月营销月历待查收! 建议收藏 !
- leetcode points to Offer 10- I. Fibonacci sequence
- PAT Class B-B1019 Digital Black Hole (20)
- 如何实现按键的短按、长按检测?
- 只有一台交换机,如何实现主从自动切换之nqa
- Science bosses say | Hong Kong rhubarb KaiBin teacher take you unlock the relationship between the matrix and 6 g
猜你喜欢

茄子科技CEO仇俊:以用户为中心,做用户真正需要的产品

5.部署web项目到云服务器

Qiu Jun, CEO of Eggplant Technology: Focus on users and make products that users really need

Keil升级到AC6后,到底有哪些变化?

汇编语言(8)x86内联汇编

CCVR eases heterogeneous federated learning based on classifier calibration

eKuiper Newsletter 2022-07|v1.6.0:Flow 编排 + 更好用的 SQL,轻松表达业务逻辑

Custom filters and interceptors implement ThreadLocal thread closure

营销建议 | 您有一份八月营销月历待查收! 建议收藏 !

Seata source code analysis: initialization process of TM RM client
随机推荐
欧盟 | 地平线 2020 ENSEMBLE:D2.13 SOTIF Safety Concept(上)
Going to book tickets tomorrow, ready to go home~~
无题十四
Hundred lines of code launch red hearts, why programmers lose their girlfriends!
Voice conversion相关语音数据集综合汇总
Oracle temporary table space role
程序员的七种武器
Four years of weight loss record
深度学习21天——卷积神经网络(CNN):服装图像分类(第3天)
leetcode 剑指 Offer 10- II. 青蛙跳台阶问题
hcip BGP 增强实验
C语言-数组
Qiu Jun, CEO of Eggplant Technology: Focus on users and make products that users really need
欧盟 | 地平线 2020 ENSEMBLE:D2.13 SOTIF Safety Concept(下)
无题七
Advanced usage of C language
歌词整理
CPU的亲缘性affinity
Microservice Technology Stack
Excuse me if you want to write data in mysql, with flink - connector - JDBC directly is ok, but I'm in the f