jamesaburnell / threejs-text-wrapper

Automatic text geometry wrapping in three.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

threejs-text-wrapper

Text geometry wrapping in three.js

Requires the Three.js TextGeometry, FontUtils, and a typeface.js font to work! You can find all these files and some existing typeface fonts at https://github.com/mrdoob/three.js

Usage

var Wrapper = new TextWrapper();

var input = 'some super long text that needs to wrap';
		
var text = Wrapper.Wrap({ 
	string: input, 
	size: 5, 
	color: 0x0000FF, 
	lineLength: 50, 
	height: .2, 
	coords: {
	     x: 0,
	     y: 0,
	     z: 0
	} 
});

scene.add( text );

About

Automatic text geometry wrapping in three.js


Languages

Language:JavaScript 98.9%Language:HTML 1.1%