Experience-Monks/three-bmfont-text

is there a raw three.js example ?

jeromeetienne opened this issue ยท 3 comments

hi,

i would like to use this module for its clean look for text. But i do three.js with rather raw tooling.. a bit like three.js examples. im not up to date on all the new preprocessing.

Is there a simple example working with raw three.js ?

thanks :)

Somehow we end up in the same place @jeromeetienne ... ๐Ÿ˜‚ what a coincidence.

Here is a raw example with Codepen. It uses wzrd.in to browserify the module and serve it as something you can include in a script tag.

https://codepen.io/mattdesl/pen/eRQvgX/

This uses SDF text with a custom shader to give it a wavy effect. The font is loaded with load-bmfont which is also browserified with wzrd.in, however you could also convert the .fnt file into JSON with convert-bmfont and then use the fetch() API if you wanted to avoid another dependency.

You can download the JS library for this module with either of these links:

Minified:
https://wzrd.in/standalone/three-bmfont-text@latest

Unminified + source maps:
https://wzrd.in/debug-standalone/three-bmfont-text@latest

It gets attached to global scope as threeBmfontText, and expects THREE.js to already exist on global scope.

@mattdesl excelent thanks!