Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix three.js BufferGeometry dependency #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var createLayout = require('layout-bmfont-text')
var inherits = require('inherits')
var createIndices = require('quad-indices')

var vertices = require('./lib/vertices')
Expand All @@ -11,23 +10,22 @@ module.exports = function createTextGeometry (opt) {
return new TextGeometry(opt)
}

function TextGeometry (opt) {
Base.call(this)

if (typeof opt === 'string') {
opt = { text: opt }
class TextGeometry extends Base {
constructor (opt) {
super()
if (typeof opt === 'string') {
opt = { text: opt }
}

// use these as default values for any subsequent
// calls to update()
this._opt = Object.assign({}, opt)

// also do an initial setup...
if (opt) this.update(opt)
}

// use these as default values for any subsequent
// calls to update()
this._opt = Object.assign({}, opt)

// also do an initial setup...
if (opt) this.update(opt)
}

inherits(TextGeometry, Base)

TextGeometry.prototype.update = function (opt) {
if (typeof opt === 'string') {
opt = { text: opt }
Expand Down
Loading