How can I display text in A-Frame?

后端 未结 1 1573
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-20 16:53

For http://aframe.io/, how can I render text without having to create an image?

1条回答
  •  甜味超标
    2021-02-20 17:10

    EDIT: A text component has landed in A-Frame master branch. This will roll out in 0.5.0. The component will have support for fonts, alignments, anchors, baselines, shaders, etc. https://aframe.io/docs/master/components/text.html

    You can use some of the community components:

    • https://github.com/bryik/aframe-bmfont-text-component - Text drawn using signed distance field fonts (bitmap fonts that look great regardless of zoom level).
    • https://npmjs.com/package/aframe-text-geometry-component - Text geometries.
    • https://github.com/maxkrieger/aframe-textwrap-component - Draw component focused on text wrapping.
    • https://github.com/scenevr/htmltexture-component - HTML canvas as a texture.

    I recommend the Bitmap Font Text Component which is performant and looks visually good:

    
      
        
        
      
      
        
          
        
      
    
    

    0 讨论(0)
提交回复
热议问题