Added images path to nonessential data.

This commit is contained in:
NathanSweet 2014-10-06 15:04:21 +02:00
parent 1c4712aeb4
commit 5f8dd415a5
3 changed files with 22 additions and 2 deletions

View File

@ -113,6 +113,12 @@ public class SkeletonBinary {
skeletonData.height = input.readFloat();
boolean nonessential = input.readBoolean();
if (nonessential) {
String imagesPath = input.readString();
if (imagesPath.length() > 0) skeletonData.imagesPath = imagesPath;
}
// Bones.
for (int i = 0, n = input.readInt(true); i < n; i++) {
String name = input.readString();

View File

@ -42,7 +42,7 @@ public class SkeletonData {
final Array<Animation> animations = new Array();
final Array<IkConstraintData> ikConstraints = new Array();
float width, height;
String version, hash;
String version, hash, imagesPath;
// --- Bones.
@ -197,23 +197,36 @@ public class SkeletonData {
this.height = height;
}
/** Returns the Spine version used to export this data. */
/** Returns the Spine version used to export this data, or null. */
public String getVersion () {
return version;
}
/** @param version May be null. */
public void setVersion (String version) {
this.version = version;
}
/** @return May be null. */
public String getHash () {
return hash;
}
/** @param hash May be null. */
public void setHash (String hash) {
this.hash = hash;
}
/** @return May be null. */
public String getImagesPath () {
return imagesPath;
}
/** @param imagesPath May be null. */
public void setImagesPath (String imagesPath) {
this.imagesPath = imagesPath;
}
public String toString () {
return name != null ? name : super.toString();
}

View File

@ -99,6 +99,7 @@ public class SkeletonJson {
skeletonData.version = skeletonMap.getString("spine");
skeletonData.width = skeletonMap.getFloat("width");
skeletonData.height = skeletonMap.getFloat("height");
skeletonData.imagesPath = skeletonMap.getString("images", null);
}
// Bones.