Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jgtools/textmesh
TextMesh for ThreeJS
https://github.com/jgtools/textmesh
javascript jgtools text-geometry text-mesh threejs typescript
Last synced: 3 months ago
JSON representation
TextMesh for ThreeJS
- Host: GitHub
- URL: https://github.com/jgtools/textmesh
- Owner: JGTools
- License: mit
- Created: 2022-12-28T12:09:51.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-05T00:00:22.000Z (6 months ago)
- Last Synced: 2024-10-14T01:10:53.117Z (3 months ago)
- Topics: javascript, jgtools, text-geometry, text-mesh, threejs, typescript
- Language: TypeScript
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TextMesh
[![npm](https://img.shields.io/npm/v/@jgtools/textmesh)](https://www.npmjs.com/package/@jgtools/textmesh)
[![npm](https://img.shields.io/npm/dm/@jgtools/textmesh)](https://www.npmjs.com/package/@jgtools/textmesh)
[![GitHub](https://img.shields.io/github/license/jgtools/textmesh)](https://github.com/git/git-scm.com/blob/main/MIT-LICENSE.txt)TextMesh for ThreeJS that extends Mesh and uses TextGeometry.
## Installation
### Using npm
```bash
npm i @jgtools/textmesh
``````javascript
import TextMesh from "@jgtools/textmesh";
// ...
```### Using cdn
```html
import TextMesh from "https://cdn.jsdelivr.net/npm/@jgtools/[email protected]/dist/index.min.js";
// ...```
## Usage
```javascript
import { FontLoader } from "three/examples/jsm/loaders/FontLoader";
import TextMesh from "@jgtools/textmesh";const loader = new FontLoader();
const font = await loader.loadAsync("font.json");const mesh = new TextMesh(font);
mesh.setText("Hello World!");// use it as a regular Mesh
scene.add(mesh);// get text as string
const text = mesh.getText();
```## License
MIT