Browse Source

Path for RegionAttachment.

NathanSweet 11 years ago
parent
commit
3977ce93e2

+ 1 - 0
spine-libgdx/src/com/esotericsoftware/spine/attachments/AtlasAttachmentLoader.java

@@ -48,6 +48,7 @@ public class AtlasAttachmentLoader implements AttachmentLoader {
 
 	public RegionAttachment newRegionAttachment (Skin skin, String name, String path) {
 		RegionAttachment attachment = new RegionAttachment(name);
+		attachment.setPath(path);
 		AtlasRegion region = atlas.findRegion(path);
 		if (region == null)
 			throw new RuntimeException("Region not found in atlas: " + attachment + " (region attachment: " + name + ")");

+ 9 - 0
spine-libgdx/src/com/esotericsoftware/spine/attachments/RegionAttachment.java

@@ -57,6 +57,7 @@ public class RegionAttachment extends Attachment {
 	static public final int BRY = 7;
 
 	private TextureRegion region;
+	private String path;
 	private float x, y, scaleX = 1, scaleY = 1, rotation, width, height;
 	private final float[] vertices = new float[20];
 	private final float[] offset = new float[8];
@@ -275,4 +276,12 @@ public class RegionAttachment extends Attachment {
 	public Color getColor () {
 		return color;
 	}
+
+	public String getPath () {
+		return path;
+	}
+
+	public void setPath (String path) {
+		this.path = path;
+	}
 }