我正在尝试使用名为 yOffset 的 aframe 文本组件的属性。此属性未在文档中列出,但出现在组件的架构中。应用时没有任何反应。 xOffset 和 zOffset 属性通常通过沿各自的轴移动文本来工作。
这是一个基本的例子来演示。理论上 a 平面上的文字应该向下移动 10 厘米,但什么也没有发生。
<!DOCTYPE html>
<html>
<head>
<script src="https://aframe.io/releases/1.4.2/aframe.min.js"></script>
</head>
<body>
<a-scene>
<a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
<a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere>
<a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D">
<a-plane
material="shader: flat"
color="#444357"
position="0 1.1 0"
width="1.4"
height="0.4"
text="value: LABEL; width: 2; letterSpacing: 10px; yOffset: 1; align: center;"
></a-plane>
</a-cylinder>
<a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
<a-sky color="#ECECEC"></a-sky>
</a-scene>
</body>
</html>
这里是故障示例的链接example
来自来源:
//
调整从可能具有不正确指标的工具生成的字体。yOffset
看起来这是一个针对非默认字体的功能,以防字形关闭。一旦你加载了一个字体它的工作:
<script src="https://aframe.io/releases/1.4.2/aframe.min.js"></script>
<a-scene>
<a-plane
material="shader: flat"
color="#444357"
position="0 1.1 -1"
width="1.4"
height="0.4"
text="font: https://cdn.aframe.io/fonts/mozillavr.fnt;
value: LABEL; width: 2; letterSpacing: 10px; yOffset:50; align: center;">
</a-plane>
</a-scene>
不确定它是否用于定位,而不是修复。