aframe-textarea-component
v0.3.0
Published
A Textarea component for A-Frame.
Downloads
13
Maintainers
Readme
aframe-textarea-component
A Textarea component for A-Frame.
Examples
Known issues
- Does not support text word-wrap.
- Only supports monospace fonts.
API
| Property | Description | Default Value | | -------- | ----------- | ------------- | | cols | number of columns in the textarea | 40 | | rows | number of rows in the textarea | 20 | | color | color of the text | black | | disabled | whether the control can receive keyboard inputs | false | | selectionColor | color of selected text | grey | | backgroundColor | color of the background | white | | disabledBackgroundColor | color of the background when disabled | lightgrey | | text | default text in the textarea | '' |
| Method | Description | | -------- | ----------- | | 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');