Browse Source

[cpp] Expose x and y of SkeletonData via getters/setters. Closes #1518.

badlogic 6 years ago
parent
commit
007397c4c4

+ 1 - 0
CHANGELOG.md

@@ -82,6 +82,7 @@
   * Added `Attachment#copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.
   * Added `MeshAttachment#newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.
   * Added IK softness.
+  * Exposed `x` and `y` on `SkeletonData` through getters and setters.
 
 ### Cocos2d-x
 * Updated to cocos2d-x 3.17.1

+ 8 - 0
spine-cpp/spine-cpp/include/spine/SkeletonData.h

@@ -127,6 +127,14 @@ public:
 
 	Vector<PathConstraintData *> &getPathConstraints();
 
+	float getX();
+
+	void setX(float inValue);
+
+	float getY();
+
+	void setY(float inValue);
+
 	float getWidth();
 
 	void setWidth(float inValue);

+ 16 - 0
spine-cpp/spine-cpp/src/spine/SkeletonData.cpp

@@ -168,6 +168,22 @@ Vector<PathConstraintData *> &SkeletonData::getPathConstraints() {
 	return _pathConstraints;
 }
 
+float SkeletonData::getX() {
+	return _x;
+}
+
+void SkeletonData::setX(float inValue) {
+	_x = inValue;
+}
+
+float SkeletonData::getY() {
+	return _y;
+}
+
+void SkeletonData::setY(float inValue) {
+	_y = inValue;
+}
+
 float SkeletonData::getWidth() {
 	return _width;
 }