Text wrapping for AFrame draw.
npm install aframe-textwrap-componentWrappable text as a material for an A-Frame VR entity. Requires draw.
!demo
All attributes are listed below.
npm i aframe-draw-component --save
npm i aframe-textwrap-component --save
`
##UsageRegister the component with AFrame:
`js
var AFRAME = require("aframe-core");
var draw = require("aframe-draw-component").component;
var textwrap = require("aframe-textwrap-component").component;
AFRAME.registerComponent("draw", draw);
AFRAME.registerComponent("textwrap", textwrap);
`Then integrate it on an entity:
`html
`
##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.