Path for RegionAttachment.

This commit is contained in:
NathanSweet 2013-11-30 15:57:54 +01:00
parent 57c94b51d7
commit 3977ce93e2
2 changed files with 10 additions and 0 deletions

View File

@ -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 + ")");

View File

@ -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;
}
}