mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-02 21:59:09 +08:00
Path for RegionAttachment.
This commit is contained in:
parent
57c94b51d7
commit
3977ce93e2
@ -48,6 +48,7 @@ public class AtlasAttachmentLoader implements AttachmentLoader {
|
|||||||
|
|
||||||
public RegionAttachment newRegionAttachment (Skin skin, String name, String path) {
|
public RegionAttachment newRegionAttachment (Skin skin, String name, String path) {
|
||||||
RegionAttachment attachment = new RegionAttachment(name);
|
RegionAttachment attachment = new RegionAttachment(name);
|
||||||
|
attachment.setPath(path);
|
||||||
AtlasRegion region = atlas.findRegion(path);
|
AtlasRegion region = atlas.findRegion(path);
|
||||||
if (region == null)
|
if (region == null)
|
||||||
throw new RuntimeException("Region not found in atlas: " + attachment + " (region attachment: " + name + ")");
|
throw new RuntimeException("Region not found in atlas: " + attachment + " (region attachment: " + name + ")");
|
||||||
|
|||||||
@ -57,6 +57,7 @@ public class RegionAttachment extends Attachment {
|
|||||||
static public final int BRY = 7;
|
static public final int BRY = 7;
|
||||||
|
|
||||||
private TextureRegion region;
|
private TextureRegion region;
|
||||||
|
private String path;
|
||||||
private float x, y, scaleX = 1, scaleY = 1, rotation, width, height;
|
private float x, y, scaleX = 1, scaleY = 1, rotation, width, height;
|
||||||
private final float[] vertices = new float[20];
|
private final float[] vertices = new float[20];
|
||||||
private final float[] offset = new float[8];
|
private final float[] offset = new float[8];
|
||||||
@ -275,4 +276,12 @@ public class RegionAttachment extends Attachment {
|
|||||||
public Color getColor () {
|
public Color getColor () {
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPath () {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPath (String path) {
|
||||||
|
this.path = path;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user