Skip to content

kinyoklion/three-text2d

 
 

Repository files navigation

three-text2d

Render texture from canvas into THREE's Mesh or Sprite.

This is an updated version of: https://github.com/gamestdio/three-text2d

It was updated to support three.js r133 and newer. These updates were made with no regard to compatibility with previous versions.

Usage

Mesh

import { MeshText2D, textAlign } from 'three-text2d'

var text = new MeshText2D("RIGHT", { align: textAlign.right, font: '30px Arial', fillStyle: '#000000', antialias: true })
scene.add(text)

Sprite

import { SpriteText2D, textAlign } from 'three-text2d'

var sprite = new SpriteText2D("SPRITE", { align: textAlign.center,  font: '40px Arial', fillStyle: '#000000' , antialias: false })
scene.add(sprite)

License

MIT

About

Render texture from canvas into THREE's Mesh or Sprite.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 63.5%
  • JavaScript 24.8%
  • HTML 11.7%