Provide an api to get the calulated rotation center from the rendered costume

This commit is contained in:
Karishma Chadha
2018-04-20 00:01:41 -04:00
parent 4d1aed64a7
commit 1f574d6ee3

View File

@@ -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<number>} 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.