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

时间:2016-03-29 06:12:24

标签: webvr aframe

对于http://aframe.io/,如何在不创建图像的情况下渲染文本?

1 个答案:

答案 0 :(得分:18)

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

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

我推荐使用性能良好的Bitmap字体文本组件:

<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>