Merge pull request #254 from paulkaplan/skin-size

Add method for getting the size of a skin by skin id.
This commit is contained in:
Paul Kaplan
2018-04-11 09:30:23 -04:00
committed by GitHub

View File

@@ -478,9 +478,19 @@ class RenderWebGL extends EventEmitter {
* @param {int} drawableID The ID of the Drawable to measure.
* @return {Array<number>} Skin size, width and height.
*/
getSkinSize (drawableID) {
getCurrentSkinSize (drawableID) {
const drawable = this._allDrawables[drawableID];
return drawable.skin.size;
return this.getSkinSize(drawable.skin.id);
}
/**
* Get the size of a skin by ID.
* @param {int} skinID The ID of the Skin to measure.
* @return {Array<number>} Skin size, width and height.
*/
getSkinSize (skinID) {
const skin = this._allSkins[skinID];
return skin.size;
}
/**