当前位置:网站首页>Ue5 magic power - POI solution
Ue5 magic power - POI solution
2022-06-27 08:03:00 【xosg】
UE5: Universal POI Source code
In 3D visualization , The most common function is to locate a POI spot (point of interest, Point of interest ), Represents a coordinate concerned by users in 3D space , It is usually necessary to mark this coordinate position in the screen space , Point to this through an arrow line POI And write some attribute information next to it .

Point to by an arrow POI The exact location , Avoid a picture covering POI front .
Through the preset Font Icon Library , Specify any icon ( character ), Avoid the difficulty of image management .
Allow to mark the name in the icon narration , Express in short words POI The title of the .
POI The title can be omitted , Representing pure icons POI.
The shape of the icon frame can be selected : The diamond 、 circular 、 Rounded corners, squares, etc .
The overall theme color can be selected , The color affects the arrow lines 、 Icon 、 Icon outline 、 written words .

therefore , This solution provides so many configurable styles , Can satisfy the vast majority of POI The needs of the point , Users can freely combine these options , stay UI Show a variety of POI spot , At the same time, make the overall style unified . Now let's share this general POI Source program of resources ( Design drawings ). First of all, you need to prepare 5 Assets :
Regular Fonts (Font Face): For title text , Including common Chinese and English characters .
Icon Font (Font Face): For icons , Deposit three or five hundred beautiful icon, Use Unicode Reserved code segment .
Font package (Font): For assembling General and icon fonts .
UI Components (Widget Blueprint): For assembling UI Elements .
Actor Components (Blueprint Class): For encapsulation UI Components .
About the regular font files, you can download various Chinese font libraries from the Internet ( contain ASCII character ), Chinese word libraries are usually a few M size . Icon font files should be carefully prepared , Yes, please UI The group designs a stack of icon, Or from the major free icon The website looks for the right download , Finally, the font file can be generated by packaging , Icon libraries are usually just a few hundred K size . Drag the font file directly to UE5 Will generate FontFace 了 . Then you need a Font Assets will be before 2 individual FontFace encapsulated , then Font Both the icon in the upper left corner and the text in the upper right corner . Why not 2 individual FontFace Become , The reason is that the icon library often needs to be updated with the business , But the Chinese library is basically unchanged , So it will 2 Decoupler . In this way , Icons and titles can use any character . Next you need to draw UI Component , Create a new one Widget The blueprint , Add the following labels :

Except that the width of the title block varies with the length of the string , Whole UMG The size of the is fixed , Here we need to put the center point (pivot point) Center the arrow in the lower left corner , So when the lens rotates , The position of the arrow point is fixed , Whole UMG Rotate around the arrow point .

Finally, we need a Actor Blueprints to encapsulate the above UMG: Add one to the blueprint Widget Component And set it to screen space rendering mode . This blueprint is mainly used to deal with the interface parameters passed from pixels , And click POI The return value after . The format of the pixel stream interface is as follows :
ps.emitMessage({
"type": "spawn-poi", "location": "X=18086 Y=1223779 Z=5204", "icon": "\uE999", "name": "POI Point name ", "color": "R=1 G=1 B=1 A=1", "id": "poi001 type 1 type 2", "shape": "0" }); The interface needs to pass in the following parameters , You can generate a custom in the scene POI spot .
type : Fixed string "spawn-poi".
coordinate : Company cm, It is necessary to convert the longitude, latitude and altitude into a three-dimensional space XYZ.
Icon : Pass a Unicode character ( Customize Font Icon Library in advance ).
name :POI The title displayed next to the icon ( May be empty ).
Color :POI Dot theme color ,RGB The scope is 0~1.
shape :0 The diamond ,1 circular ,2 Rounded square .
label : Space delimited string array , such as ID And type .
POI When clicked, it will return to this POI All the labels , At the same time, let the camera focus on this so that POI In the center of the screen . thus ,5 All the assets have been made , This POI It can be directly dragged into the scene as a built-in actor, It can also be generated temporarily through the pixel stream .
边栏推荐
- L'introduction en bourse de Wild Wind Pharmaceutical a pris fin: Yu pinzeng, qui avait l'intention de lever 540 millions de RMB, a effectué un investissement P2P.
- 八大误区,逐个击破(终篇):云难以扩展、定制性差,还会让管理员失去控制权?
- The 6th Blue Bridge Cup
- 【c ++ primer 笔记】第3章 字符串、向量和数组
- js判断用户输入的数是否为质数(多种方法)
- JS use switch to output whether the result is qualified
- JS print 99 multiplication table
- Binary tree structure and heap structure foundation
- Recognize the ordering of O (nlogn)
- 无论LCD和OLED显示技术有多好,都无法替代这个古老的显示数码管
猜你喜欢
![【批处理DOS-CMD命令-汇总和小结】-批处理命令中的参数%0、%1、%2、%[0-9]、%0-9和批处理命令参数位置切换命令shift,dos命令中操作符%用法](/img/05/19299c47d54d4ede95322b5a923093.png)
【批处理DOS-CMD命令-汇总和小结】-批处理命令中的参数%0、%1、%2、%[0-9]、%0-9和批处理命令参数位置切换命令shift,dos命令中操作符%用法

cookie加密7 fidder分析阶段

(note) Anaconda navigator flashback solution

盲測調查顯示女碼農比男碼農更優秀

(笔记)Anaconda-Navigator闪退解决方法

参考 | 升级 Win11 移动热点开不了或者开了连不上

Reference | upgrade win11 mobile hotspot can not be opened or connected

【批处理DOS-CMD命令-汇总和小结】-环境变量、路径变量、搜索文件位置相关指令——set、path、where,cmd命令的路径参数中有空格怎么办
![[c++ primer notes] Chapter 4 expression](/img/cb/d543dd1f461653e9adf399b42d1d26.png)
[c++ primer notes] Chapter 4 expression

How to view program running time (timer) in JS
随机推荐
什么是期货反向跟单?
Sword finger offer 07 Rebuild binary tree
JS example print the number and sum of multiples of all 7 between 1-100
基础知识 | js基础
野风药业IPO被终止:曾拟募资5.4亿 实控人俞蘠曾进行P2P投资
[batch dos-cmd command - summary and summary] - how to distinguish the internal command and external command of CMD, and the difference between CMD command and run (win+r) command,
[c++ primer notes] Chapter 4 expression
SQL Sever column name or number of supplied values does not match the table definition
How to bind SQL statements to web buttons
Remote connection raspberry pie in VNC Viewer Mode
c#的初步认识
Stream常用操作以及原理探索
If xn > 0 and X (n+1) /xn > 1-1/n (n=1,2,...), Prove that the series Σ xn diverges
Futures reverse Documentary - training for traders
PayPal账户遭大规模冻结!跨境卖家如何自救?
js中判断奇偶的函数,求圆面积的函数
[Software Engineering] software engineering review outline of Shandong University
What is futures reverse documentary?
(resolved) the following raise notimplementederror occurs when Minet tests
Implementation of game hexagon map