This commit is contained in:
badlogic 2019-04-12 17:12:09 +02:00
commit 19fc021d58
3 changed files with 23 additions and 1 deletions

View File

@ -175,6 +175,8 @@ public class SkeletonBinary {
if (skeletonData.hash.isEmpty()) skeletonData.hash = null;
skeletonData.version = input.readString();
if (skeletonData.version.isEmpty()) skeletonData.version = null;
skeletonData.x = input.readFloat();
skeletonData.y = input.readFloat();
skeletonData.width = input.readFloat();
skeletonData.height = input.readFloat();

View File

@ -47,7 +47,7 @@ public class SkeletonData {
final Array<IkConstraintData> ikConstraints = new Array();
final Array<TransformConstraintData> transformConstraints = new Array();
final Array<PathConstraintData> pathConstraints = new Array();
float width, height;
float x, y, width, height;
String version, hash;
// Nonessential.
@ -234,6 +234,24 @@ public class SkeletonData {
this.name = name;
}
/** The X coordinate of the skeleton's axis aligned bounding box in the setup pose. */
public float getX () {
return x;
}
public void setX (float x) {
this.x = x;
}
/** The Y coordinate of the skeleton's axis aligned bounding box in the setup pose. */
public float getY () {
return y;
}
public void setY (float y) {
this.y = y;
}
/** The width of the skeleton's axis aligned bounding box in the setup pose. */
public float getWidth () {
return width;

View File

@ -122,6 +122,8 @@ public class SkeletonJson {
if (skeletonMap != null) {
skeletonData.hash = skeletonMap.getString("hash", null);
skeletonData.version = skeletonMap.getString("spine", null);
skeletonData.x = skeletonMap.getFloat("x", 0);
skeletonData.y = skeletonMap.getFloat("y", 0);
skeletonData.width = skeletonMap.getFloat("width", 0);
skeletonData.height = skeletonMap.getFloat("height", 0);
skeletonData.fps = skeletonMap.getFloat("fps", 30);