npm i meshwriter
and add earcut inindex.html
<script src="https://preview.babylonjs.com/earcut.min.js"></script>
Then you can use it like
import * as MeshWriter from "meshwriter";
let Writer = new MeshWriter(scene, { scale: 0.1, defaultFont: "Arial" });
let text1 = new Writer(
"Blah Blah",
{
"anchor": "center",
"letter-height": 100,
"color": "#1C3870",
"position": {
"x": 0,
"y":4,
"z":5
},
"letter-thickness":2,
}
);