mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[libgdx] Added x and y coordinates for setup pose AABB.
This commit is contained in:
parent
bf0999e202
commit
269e3970ba
@ -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();
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user