diff --git a/package.json b/package.json index e766c62..416615c 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "json": "^9.0.4", "linebreak": "0.3.0", "raw-loader": "^0.5.1", - "scratch-svg-renderer": "0.1.0-prerelease.20180329174139", + "scratch-svg-renderer": "0.1.0-prerelease.20180423193917", "tap": "^11.0.0", "travis-after-all": "^1.4.4", "twgl.js": "4.4.0", diff --git a/src/BitmapSkin.js b/src/BitmapSkin.js index ecd2dc9..8d7efaf 100644 --- a/src/BitmapSkin.js +++ b/src/BitmapSkin.js @@ -90,7 +90,7 @@ class BitmapSkin extends Skin { } // Do these last in case any of the above throws an exception - this._costumeResolution = costumeResolution || 1; + this._costumeResolution = costumeResolution || 2; this._textureSize = BitmapSkin._getBitmapSize(bitmapData); if (typeof rotationCenter === 'undefined') rotationCenter = this.calculateRotationCenter(); diff --git a/src/RenderWebGL.js b/src/RenderWebGL.js index 80f4fb2..ffa43b5 100644 --- a/src/RenderWebGL.js +++ b/src/RenderWebGL.js @@ -493,6 +493,16 @@ class RenderWebGL extends EventEmitter { return skin.size; } + /** + * Get the rotation center of a skin by ID. + * @param {int} skinID The ID of the Skin + * @return {Array} The rotationCenterX and rotationCenterY + */ + getSkinRotationCenter (skinID) { + const skin = this._allSkins[skinID]; + return skin.calculateRotationCenter(); + } + /** * Check if a particular Drawable is touching a particular color. * Unlike touching drawable, touching color tests invisible sprites. diff --git a/src/SVGSkin.js b/src/SVGSkin.js index 409ed1f..4633a5a 100644 --- a/src/SVGSkin.js +++ b/src/SVGSkin.js @@ -2,7 +2,7 @@ const twgl = require('twgl.js'); const Silhouette = require('./Silhouette'); const Skin = require('./Skin'); -const SvgRenderer = require('scratch-svg-renderer'); +const SvgRenderer = require('scratch-svg-renderer').SVGRenderer; const MAX_TEXTURE_DIMENSION = 2048; diff --git a/src/util/svg-text-bubble.js b/src/util/svg-text-bubble.js index 4332e81..d0288b4 100644 --- a/src/util/svg-text-bubble.js +++ b/src/util/svg-text-bubble.js @@ -1,5 +1,5 @@ const SVGTextWrapper = require('./svg-text-wrapper'); -const SvgRenderer = require('scratch-svg-renderer'); +const SvgRenderer = require('scratch-svg-renderer').SVGRenderer; const xmlescape = require('xml-escape'); const MAX_LINE_LENGTH = 170;