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

问题描述 投票:7回答:1

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

webvr aframe
1个回答
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>
© www.soinside.com 2019 - 2024. All rights reserved.