当前位置:网站首页>Ugui uses tips (VI) unity to realize vertical line display of string
Ugui uses tips (VI) unity to realize vertical line display of string
2022-06-28 12:21:00 【Unique_ eight hundred and forty-nine million nine hundred and n】
I have a problem recently , Planning needs , Words are like ancient books , From right to left , Vertical display .
I used to think UGUI Of Text Can meet this demand , I thought I could set a certain property , Change the text displayed horizontally to a vertical line , When you do something, you don't find a native solution , Then I simply raked around the Internet , Two solutions have been found .
The first is , Set to Text The text lines of the component are converted to columns, and the rest are displayed with spaces .
The second is rewriting Text Some functions of the group , I didn't understand how to get it .
Then I tried both methods , There are Bug, Then I used a simple method to replace , Can solve current problems .
I use GridLayoutGroup Component to implement this function :
1、 stay GameObject Add Text The components are made into a prefabricated Item;
2、 Replace the text string that needs to be displayed in the vertical line with Char Array ;
3、 Circular array , Instantiation Item, take Char The values in the array are set to Item Of Text Inside the component , One Item Set a value ;( If you have line breaks in your text , You need to calculate the space added to Array or List Inside )
4、 Set up GridLayoutGroup attribute , utilize GridLayoutGroup Realize the function of displaying text in vertical line .

This is me GridLayoutGroup Set properties . The renderings are as follows :

That's what I passed GridLayoutGroup Component to realize the vertical line display of string , If you don't have much text 、 unchanging , This method can be used , If you have a lot of text , The converted character array is relatively large , It is not recommended to use . The best way is to rewrite Text Well , But I saw Text Source code , I don't know where to start .
If you have a better way , Looking forward to your sharing !
边栏推荐
- Convert black mask picture to color annotation file
- Android应用安全之JNI混淆
- Difference (one dimension)
- 纯纯大怨种!那些年被劝退的考研专业
- AcWing 604. Area of circle (implemented in C language)
- NFT数字藏品系统开发(3D建模经济模型开发案例)
- IDEA全局搜索快捷设置
- JNI函数的2种书写方式
- Is it feasible to be a programmer at the age of 26?
- Setting overridesorting for canvas does not take effect
猜你喜欢

【C语言】随机数文件对其进行三种排序方法

Many benefits of SEO optimization are directly related to traffic

Swin, three degrees! Eth open source VRT: a transformer that refreshes multi domain indicators of video restoration

EMC RS485 interface EMC circuit design scheme

Self use demo of basic component integration of fluent

Prefix and (2D)

JNI confusion of Android Application Security

开源项目维权成功案例: spug 开源运维平台成功维权

Data analysis learning notes

UGUI使用小技巧(五) Scroll Rect组件的使用
随机推荐
AcWing 608. Poor (implemented in C language)
Levels – 虚幻引擎场景制作「建议收藏」
开源项目维权成功案例: spug 开源运维平台成功维权
How to deploy the software testing environment?
MapReduce project case 3 - temperature statistics
Deep learning has a new pit! The University of Sydney proposed a new cross modal task, using text to guide image matting
PyQt5可视化开发
【JS】斐波那契数列实现(递归与循环)
案例驱动 :从入门到掌握Shell编程详细指南
[source code + code comments] error state Kalman filter, extended Kalman filter, gps+imu fusion, EKF eskf gps+imu
6. calculation index
RemoteViews的作用及原理
Many benefits of SEO optimization are directly related to traffic
Is tongdaxin stock software reliable? Is it safe to trade stocks on it?
请问通达信股票软件可靠吗?在上面交易股票安全吗?
Three ways to implement LRU cache (recommended Collection)
【C语言】结构体嵌套二级指针的使用
Zero basic C language (I)
Int~long long indicates the maximum and minimum number
Url追加参数方法,考虑#、?、$的情况