Skip to content
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