如何在A-Frame中显示文本?

10
1个回答

20

编辑:文本组件已经加入A-Frame主分支,将在0.5.0版本中推出。该组件将支持字体、对齐、锚点、基线、着色器等功能。<a-entity text="value: HELLO"></a-entity> https://aframe.io/docs/master/components/text.html

你可以使用一些社区组件:

我推荐使用位图字体文本组件,它具有高性能和良好的视觉效果:

<html>
  <head>
    <script src="https://aframe.io/releases/0.2.0/aframe.min.js"></script>
    <script src="https://rawgit.com/bryik/aframe-bmfont-text-component/master/dist/aframe-bmfont-text-component.min.js"></script>
  </head>
  <body>
    <a-scene>
      <a-entity bmfont-text="text: HELLO!; color: #333" position="0 0 -5"></a-entity>
    </a-scene>
  </body>
</html>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接