AFrame Text Wrap Component
Wrappable text as a material for an A-Frame VR entity. Requires draw
.
All attributes are listed below.
Installation
npm i aframe-draw-component --save
npm i aframe-textwrap-component --save
Usage
Register the component with AFrame:
var AFRAME = ;var draw = component;var textwrap = component;AFRAME;AFRAME;
Then integrate it on an entity:
Properties
All properties have a default! :)
Property | Description |
---|---|
text |
the text that should be wrapped. If your text contains a colon (: ) or a semicolon (; ), you can escape it using url(my:text;) . |
x |
canvas x position of the text (upper left corner) |
y |
canvas y position of the text (upper left corner) |
font |
css font string (see here) |
color |
color of the text |
textAlign |
text alignment (see here) |
textBaseline |
text baseline (see here) |
direction |
text direction (see here) |
width |
width of text block in pixels |
lineHeight |
line height (vertical spacing) in pixels |
Additional Info
- Wrapping function is from here.