Browse Source

[ts] Added Skeleton.yDown

Mario Zechner 2 years ago
parent
commit
15bbf5701e
1 changed files with 11 additions and 1 deletions
  1. 11 1
      spine-ts/spine-core/src/Skeleton.ts

+ 11 - 1
spine-ts/spine-core/src/Skeleton.ts

@@ -45,6 +45,8 @@ import { Color, Utils, MathUtils, Vector2, NumberArrayLike } from "./Utils";
  *
  *
  * See [Instance objects](http://esotericsoftware.com/spine-runtime-architecture#Instance-objects) in the Spine Runtimes Guide. */
  * See [Instance objects](http://esotericsoftware.com/spine-runtime-architecture#Instance-objects) in the Spine Runtimes Guide. */
 export class Skeleton {
 export class Skeleton {
+	static yDown = false;;
+
 	/** The skeleton's setup pose data. */
 	/** The skeleton's setup pose data. */
 	data: SkeletonData;
 	data: SkeletonData;
 
 
@@ -81,7 +83,15 @@ export class Skeleton {
 
 
 	/** Scales the entire skeleton on the Y axis. This affects all bones, even if the bone's transform mode disallows scale
 	/** Scales the entire skeleton on the Y axis. This affects all bones, even if the bone's transform mode disallows scale
 	  * inheritance. */
 	  * inheritance. */
-	scaleY = 1;
+	private _scaleY	= 1;
+
+	public get scaleY() {
+		return Skeleton.yDown ? -this._scaleY : this._scaleY;
+	}
+
+	public set scaleY(scaleY: number) {
+		this._scaleY = scaleY;
+	}
 
 
 	/** Sets the skeleton X position, which is added to the root bone worldX position. */
 	/** Sets the skeleton X position, which is added to the root bone worldX position. */
 	x = 0;
 	x = 0;