mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Fix collision mask of rotated Spine objects (#6482)
- Fixes rotation of Spine objects in the editor.
This commit is contained in:
@@ -148,6 +148,9 @@ module.exports = {
|
||||
this._instance.getX(),
|
||||
this._instance.getY()
|
||||
);
|
||||
this._pixiObject.rotation = RenderedInstance.toRad(
|
||||
this._instance.getAngle()
|
||||
);
|
||||
|
||||
this.setAnimation(this._instance.getRawDoubleProperty('animation'));
|
||||
|
||||
@@ -188,6 +191,14 @@ module.exports = {
|
||||
return -this._spineOriginOffsetY;
|
||||
}
|
||||
|
||||
getCenterX() {
|
||||
return this.getOriginX();
|
||||
}
|
||||
|
||||
getCenterY() {
|
||||
return this.getOriginY();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} index - animation index
|
||||
*/
|
||||
|
@@ -124,6 +124,16 @@ namespace gdjs {
|
||||
return this.getY() + originOffset.y;
|
||||
}
|
||||
|
||||
getCenterX(): float {
|
||||
const originOffset = this._renderer.getOriginOffset();
|
||||
return -originOffset.x;
|
||||
}
|
||||
|
||||
getCenterY(): float {
|
||||
const originOffset = this._renderer.getOriginOffset();
|
||||
return -originOffset.y;
|
||||
}
|
||||
|
||||
onDestroyed(): void {
|
||||
super.onDestroyed();
|
||||
this._renderer.onDestroy();
|
||||
|
Reference in New Issue
Block a user