Provide an api to get the calulated rotation center from the rendered costume
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user