当前位置:网站首页>[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.
边栏推荐
- Microservice Technology Stack
- 交换机端口的三种类型详解与hybrid端口实验
- PAT Grade B-B1020 Mooncake(25)
- Overall design and implementation of Kubernetes-based microservice project
- 百行代码发射红心,程序员何愁命不中女朋友!
- CCVR eases heterogeneous federated learning based on classifier calibration
- 如何实现按键的短按、长按检测?
- 【零基础玩转BLDC系列】无刷直流电机无位置传感器三段式启动法详细介绍及代码分享
- Creo 9.0 基准特征:基准点
- egg框架使用(一)
猜你喜欢
Qiu Jun, CEO of Eggplant Technology: Focus on users and make products that users really need
Creo 9.0 基准特征:基准坐标系
只有一台交换机,如何实现主从自动切换之nqa
19. Server-side session technology Session
Two-table query average grouping in sql server
Creo 9.0 基准特征:基准轴
MySQL内部函数介绍
上海控安技术成果入选市经信委《2021年上海市网络安全产业创新攻关成果目录》
轩辕实验室丨欧盟EVITA项目预研 第一章(四)
蚁剑webshell动态加密连接分析与实践
随机推荐
js graphics operation one (compatible with pc, mobile terminal to achieve draggable attribute drag and drop effect)
放大器OPA855的噪声计算实例
深度学习21天——卷积神经网络(CNN):服装图像分类(第3天)
Marketing Suggestions | You have an August marketing calendar to check! Suggest a collection!
Wei Dongshan Digital Photo Frame Project Learning (6) Transplantation of tslib
Pytorch深度学习快速入门教程 -- 土堆教程笔记(三)
PAT乙级-B1021 个位数统计(15)
leetcode 剑指 Offer 10- I. 斐波那契数列
无题四
无题五
欧盟 | 地平线 2020 ENSEMBLE:D2.13 SOTIF Safety Concept(上)
Tanabata romantic date without overtime, RPA robot helps you get the job done
21 Days of Deep Learning - Convolutional Neural Networks (CNN): Clothing Image Classification (Day 3)
Concurrent CAS
【LeetCode】623. Add a row to the binary tree
营销建议 | 您有一份八月营销月历待查收! 建议收藏 !
歌词整理
tensorflow.keras无法引入layers
Happens-before rules for threads
Why do I recommend using smart async?