0.3.0 • Published 2 years ago

aframe-textarea-component v0.3.0

Weekly downloads
4
License
MIT
Repository
github
Last release
2 years ago

aframe-textarea-component

Version License

A Textarea component for A-Frame.

Examples

Demo gif

Known issues

  • Does not support text word-wrap.
  • Only supports monospace fonts.

API

PropertyDescriptionDefault Value
colsnumber of columns in the textarea40
rowsnumber of rows in the textarea20
colorcolor of the textblack
disabledwhether the control can receive keyboard inputsfalse
selectionColorcolor of selected textgrey
backgroundColorcolor of the backgroundwhite
disabledBackgroundColorcolor of the background when disabledlightgrey
textdefault text in the textarea''
MethodDescription
getText()Get the current text in the textarea
focus()Focus the textarea
blur()Blur the textarea

Installation

Browser

Install and use by directly including the browser files:

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
  <script src="https://unpkg.com/aframe-textarea-component/dist/aframe-textarea-component.min.js"></script>
</head>

<body>
  <a-scene>
    <a-entity textarea></a-entity>
  </a-scene>
</body>

npm

Install via npm:

npm install aframe-textarea-component

Then require and use.

require('aframe');
require('aframe-textarea-component');