Experience-Monks / three-bmfont-text

renders BMFont files in ThreeJS with word-wrapping
http://jam3.github.io/three-bmfont-text/test/
MIT License
789 stars 171 forks source link

Updated TextGeometry to use ES6 class format. #48

Closed jmschrack closed 2 years ago

jmschrack commented 2 years ago

What kind of change does this PR introduce? (check at least one)

Does this PR introduce a breaking change? (check one)

Did you test your solution?

I tested all the provided samples in Edge, Chrome, and Firefox. They all worked fine. šŸ‘

Problem Description

Three-bmfont-text is incompatible with ES6 classes. See: https://github.com/Jam3/three-bmfont-text/issues/46

Solution Description

var Base = THREE.BufferGeometry
function TextGeometry (opt) {
  Base.call(this)
...
}
inherits(TextGeometry, Base);

was changed to

class TextGeometry extends THREE.BufferGeometry {
  constructor(opt){
    super(opt);
...
  }
}

Side Effects, Risks, Impact

Aditional comments:

jmschrack commented 2 years ago

Accidentally made this from my master branch instead of my dev branch. Closing and reopening as https://github.com/Jam3/three-bmfont-text/pull/49