类似于这种字体,可以用Text或者Text3d,但是要处理一个问题,就是要保证字体一直正面视角。
这中间的处理比较的麻烦,于是可以使用react-three-drei中的Html来做这件事
<Html position={position} center distanceFactor={12} >
<div
style={{
position: "relative",
display: "flex",
flexDirection: "column",
...extraStyle,
textAlign:placement
}}
>
<div
class="circle"
style={{ position: "absolute", [placement]: 0 }}
></div>
<b
style={{
color: "white",
fontSize: "16px",
fontWeight: "bold",
}}
>
{warnTitle}
</b>
<span
style={{
color: "white",
fontSize: "12px",
display: "block",
wordBreak: "keep-all",
}}
>
{warnText}
</span>
</div>
</Html>