Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

three.textsprite

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

three.textsprite - npm Package Compare versions

Comparing version 18.8.6 to 18.10.24

33

package.json
{
"name": "three.textsprite",
"version": "18.8.6",
"version": "18.10.24",
"description": "Automatically computes the optimal font size depending on the distance to the camera and the size of the renderer canvas.",
"main": "THREE.TextSprite.js",
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/SeregPie/THREE.TextSprite.git"
},
"keywords": [

@@ -30,13 +20,22 @@ "3d",

],
"author": "Sergej Sintschilin",
"license": "MIT",
"author": "Sergej Sintschilin <seregpie@gmail.com>",
"main": "THREE.TextSprite.js",
"repository": "https://github.com/SeregPie/THREE.TextSprite.git",
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"prepublishOnly": "npm run build"
},
"dependencies": {
"three": "^0.95.0",
"three.texttexture": "^18.8.6"
"three.texttexture": "^18.10.24"
},
"devDependencies": {
"rollup": "^0.63.5",
"rollup-plugin-buble": "^0.19.2",
"rollup-plugin-uglify": "^4.0.0"
"rollup": "^0.66.6",
"rollup-plugin-babel-minify": "^6.1.1",
"rollup-plugin-buble": "^0.19.4"
},
"peerDependencies": {
"three": "^0.97.0"
}
}

@@ -87,2 +87,8 @@ # THREE.TextSprite

`.minFontSize = 0`
The minimum font size.
---
`.maxFontSize = Infinity`

@@ -89,0 +95,0 @@

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("three"),require("three.texttexture")):"function"==typeof define&&define.amd?define(["three","three.texttexture"],e):(t.THREE=t.THREE||{},t.THREE.TextSprite=e(t.THREE,t.THREE.TextTexture))}(this,function(s,p){"use strict";p=p&&p.hasOwnProperty("default")?p.default:p;var o=new s.Vector3,d=new s.Vector3,h=new s.Vector3;return function(n){function t(t){void 0===t&&(t={});var e=t.textSize;void 0===e&&(e=1);var r=t.redrawInterval;void 0===r&&(r=1);var i=t.maxFontSize;void 0===i&&(i=1/0);var a=t.material;void 0===a&&(a={});var o=t.texture;void 0===o&&(o={}),n.call(this,new s.SpriteMaterial(Object.assign({},a,{map:new p(o)}))),this.textSize=e,this.redrawInterval=r,this.maxFontSize=i,this.lastRedraw=0}n&&(t.__proto__=n),(t.prototype=Object.create(n&&n.prototype)).constructor=t;var e={isTextSprite:{configurable:!0}};return e.isTextSprite.get=function(){return!0},t.prototype.onBeforeRender=function(t,e,r){this.redraw(t,r)},t.prototype.updateScale=function(){this.scale.set(this.material.map.imageAspect,1,1).multiplyScalar(this.textSize*this.material.map.imageHeight)},t.prototype.updateMatrix=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return this.updateScale(),n.prototype.updateMatrix.apply(this,t)},t.prototype.redraw=function(t,e){var r=this;this.lastRedraw+this.redrawInterval<Date.now()&&(this.redrawInterval?setTimeout(function(){r.redrawNow(t,e)},1):this.redrawNow(t,e))},t.prototype.redrawNow=function(t,e){this.updateScale(),this.material.map.autoRedraw=!0,this.material.map.fontSize=Math.min(s.Math.ceilPowerOfTwo(function(t,e,r){if(e.domElement.width&&e.domElement.height&&t.material.map.textLines.length){var i=t.getWorldPosition(o).distanceTo(r.getWorldPosition(d));if(i){var a=t.getWorldScale(h).y*e.domElement.height/i;if(a)return Math.round(a/t.material.map.imageHeight)}}return 0}(this,t,e)),this.maxFontSize),this.lastRedraw=Date.now()},t.prototype.dispose=function(){this.material.map.dispose(),this.material.dispose()},Object.defineProperties(t.prototype,e),t}(s.Sprite)});
(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b(require("three"),require("three.texttexture")):"function"==typeof define&&define.amd?define(["three","three.texttexture"],b):(a.THREE=a.THREE||{},a.THREE.TextSprite=b(a.THREE,a.THREE.TextTexture))})(this,function(a,b){"use strict";function c(a,b,c){var g=Math.round;if(b.domElement.width&&b.domElement.height&&a.material.map.textLines.length){var h=a.getWorldPosition(d).distanceTo(c.getWorldPosition(e));if(h){var i=a.getWorldScale(f).y*b.domElement.height/h;if(i)return g(i/a.material.map.imageHeight)}}return 0}b=b&&b.hasOwnProperty("default")?b["default"]:b;var d=new a.Vector3,e=new a.Vector3,f=new a.Vector3,g=function(d){function e(c){void 0===c&&(c={});var e=c.textSize;void 0===e&&(e=1);var f=c.redrawInterval;void 0===f&&(f=1);var g=c.minFontSize;void 0===g&&(g=0);var h=c.maxFontSize;void 0===h&&(h=1/0);var i=c.material;void 0===i&&(i={});var j=c.texture;void 0===j&&(j={}),d.call(this,new a.SpriteMaterial(Object.assign({},i,{map:new b(j)}))),this.textSize=e,this.redrawInterval=f,this.minFontSize=g,this.maxFontSize=h,this.lastRedraw=0}d&&(e.__proto__=d),e.prototype=Object.create(d&&d.prototype),e.prototype.constructor=e;var f={isTextSprite:{configurable:!0}};return f.isTextSprite.get=function(){return!0},e.prototype.onBeforeRender=function(a,b,c){this.redraw(a,c)},e.prototype.updateScale=function(){this.scale.set(this.material.map.imageAspect,1,1).multiplyScalar(this.textSize*this.material.map.imageHeight)},e.prototype.updateMatrix=function(){for(var a=[],b=arguments.length;b--;)a[b]=arguments[b];return this.updateScale(),d.prototype.updateMatrix.apply(this,a)},e.prototype.redraw=function(a,b){var c=this;this.lastRedraw+this.redrawInterval<Date.now()&&(this.redrawInterval?setTimeout(function(){c.redrawNow(a,b)},1):this.redrawNow(a,b))},e.prototype.redrawNow=function(b,d){this.updateScale(),this.material.map.autoRedraw=!0,this.material.map.fontSize=a.Math.clamp(a.Math.ceilPowerOfTwo(c(this,b,d)),this.minFontSize,this.maxFontSize),this.lastRedraw=Date.now()},e.prototype.dispose=function(){this.material.map.dispose(),this.material.dispose()},Object.defineProperties(e.prototype,f),e}(a.Sprite);return g});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc