For http://aframe.io/ http://aframe.io/,如何在无需创建图像的情况下渲染文本?
EDIT:文本组件已登陆 A-Frame 主分支。这将在 0.5.0 中推出。该组件将支持字体、对齐方式、锚点、基线、着色器等。<a-entity text="value: HELLO"></a-entity>
https://aframe.io/docs/master/components/text.html https://aframe.io/docs/master/components/text.html
您可以使用一些社区组件:
-
https://github.com/bryik/aframe-bmfont-text-component https://github.com/bryik/aframe-bmfont-text-component- 使用带符号距离场字体绘制的文本(无论缩放级别如何,位图字体看起来都很棒)。
-
https://npmjs.com/package/aframe-text-geometry-component https://npmjs.com/package/aframe-text-geometry-component- 文本几何形状。
-
https://github.com/maxkrieger/aframe-textwrap-component https://github.com/maxkrieger/aframe-textwrap-component- 专注于文本换行的绘制组件。
-
https://github.com/scenevr/htmltexture-component https://github.com/scenevr/htmltexture-component- 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>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)