three-bmfont-text
Advanced tools
Comparing version 2.3.0 to 3.0.0
18
index.js
var createLayout = require('layout-bmfont-text') | ||
var inherits = require('inherits') | ||
var createIndices = require('quad-indices') | ||
var buffer = require('three-buffer-vertex-data') | ||
var assign = require('object-assign') | ||
@@ -25,3 +23,3 @@ var vertices = require('./lib/vertices') | ||
// calls to update() | ||
this._opt = assign({}, opt) | ||
this._opt = Object.assign({}, opt) | ||
@@ -40,3 +38,3 @@ // also do an initial setup... | ||
// use constructor defaults | ||
opt = assign({}, this._opt, opt) | ||
opt = Object.assign({}, this._opt, opt) | ||
@@ -71,3 +69,3 @@ if (!opt.font) { | ||
var uvs = vertices.uvs(glyphs, texWidth, texHeight, flipY) | ||
var indices = createIndices({ | ||
var indices = createIndices([], { | ||
clockwise: true, | ||
@@ -79,5 +77,5 @@ type: 'uint16', | ||
// update vertex data | ||
buffer.index(this, indices, 1, 'uint16') | ||
buffer.attr(this, 'position', positions, 2) | ||
buffer.attr(this, 'uv', uvs, 2) | ||
this.setIndex(indices) | ||
this.setAttribute('position', new THREE.BufferAttribute(positions, 2)) | ||
this.setAttribute('uv', new THREE.BufferAttribute(uvs, 2)) | ||
@@ -89,5 +87,5 @@ // update multipage data | ||
} else if (opt.multipage) { | ||
// enable multipage rendering | ||
var pages = vertices.pages(glyphs) | ||
// enable multipage rendering | ||
buffer.attr(this, 'page', pages, 1) | ||
this.setAttribute('page', new THREE.BufferAttribute(pages, 1)) | ||
} | ||
@@ -94,0 +92,0 @@ } |
{ | ||
"name": "three-bmfont-text", | ||
"version": "2.3.0", | ||
"version": "3.0.0", | ||
"description": "renders BMFont files in ThreeJS with word-wrapping", | ||
@@ -21,3 +21,3 @@ "main": "index.js", | ||
"layout-bmfont-text": "^1.2.0", | ||
"nice-color-palettes": "^1.0.1", | ||
"nice-color-palettes": "^3.0.0", | ||
"object-assign": "^4.0.1", | ||
@@ -28,15 +28,15 @@ "quad-indices": "^2.0.1", | ||
"devDependencies": { | ||
"bluebird": "^2.9.14", | ||
"browserify": "^12.0.1", | ||
"budo": "^7.0.2", | ||
"bluebird": "^3.7.2", | ||
"browserify": "^16.5.1", | ||
"budo": "^11.6.3", | ||
"glsl-aastep": "^1.0.1", | ||
"glsl-noise": "0.0.0", | ||
"glslify": "^4.0.0", | ||
"glslify": "^7.0.0", | ||
"load-bmfont": "^1.0.0", | ||
"standard": "^5.4.1", | ||
"standard": "^14.3.4", | ||
"sun-tzu-quotes": "^1.0.0", | ||
"three": "^0.70.0", | ||
"three": "^0.118.3", | ||
"three-orbit-viewer": "^69.2.9", | ||
"three-vignette-background": "^1.0.2", | ||
"uglify-js": "^2.4.17" | ||
"uglify-js": "^3.10.0" | ||
}, | ||
@@ -43,0 +43,0 @@ "scripts": { |
@@ -11,3 +11,3 @@ # three-bmfont-text | ||
Works on Three r69-73, r79, and possibly more. | ||
The latest `3.x` version works on Three r109 and beyond. For legacy support (e.g. Three r69-73, r79-108), please use version `three-bmfont-text@2.3.0`. | ||
@@ -165,2 +165,6 @@ Below is an example that uses [load-bmfont](https://www.npmjs.com/package/load-bmfont) to parse BMFont files on the fly with XHR: | ||
- `3.0.0` | ||
- Fixed `BufferAttribute` problems in new ThreeJS | ||
- `2.0.1` | ||
@@ -167,0 +171,0 @@ - Added `shaders/msdf.js` and docs around MSDF usage |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23721
188
436
+ Added@sindresorhus/is@0.14.0(transitive)
+ Added@szmarczak/http-timer@1.1.2(transitive)
+ Addedcacheable-request@6.1.0(transitive)
+ Addedclone-response@1.0.3(transitive)
+ Addeddefer-to-connect@1.1.3(transitive)
+ Addedduplexer3@0.1.5(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedget-stream@4.1.05.2.0(transitive)
+ Addedgot@9.6.0(transitive)
+ Addedhttp-cache-semantics@4.1.1(transitive)
+ Addedjson-buffer@3.0.0(transitive)
+ Addedkeyv@3.1.0(transitive)
+ Addedlowercase-keys@1.0.12.0.0(transitive)
+ Addednice-color-palettes@3.0.0(transitive)
+ Addednormalize-url@4.5.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedp-cancelable@1.1.0(transitive)
+ Addedprepend-http@2.0.0(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedresponselike@1.0.2(transitive)
+ Addedto-readable-stream@1.0.0(transitive)
+ Addedurl-parse-lax@3.0.0(transitive)
- Removedbuffer-to-arraybuffer@0.0.5(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removeddom-walk@0.1.2(transitive)
- Removedglobal@4.4.0(transitive)
- Removedis-function@1.0.2(transitive)
- Removedmin-document@2.19.0(transitive)
- Removednice-color-palettes@1.0.1(transitive)
- Removedparse-headers@2.0.5(transitive)
- Removedprocess@0.11.10(transitive)
- Removedquery-string@5.1.1(transitive)
- Removedsimple-concat@1.0.1(transitive)
- Removedsimple-get@2.8.2(transitive)
- Removedstrict-uri-encode@1.1.0(transitive)
- Removedtimed-out@4.0.1(transitive)
- Removedurl-set-query@1.0.0(transitive)
- Removedxhr@2.6.0(transitive)
- Removedxhr-request@1.1.0(transitive)
Updatednice-color-palettes@^3.0.0