Fixed most things besides drawing

This commit is contained in:
Anuken
2018-12-22 22:17:28 -05:00
parent 3abfaf1bca
commit 44e4ffbe62
175 changed files with 666 additions and 688 deletions

View File

@@ -21,7 +21,7 @@ public class Image {
private Color color = new Color();
public Image(BufferedImage atlas, TextureRegion region){
this(atlas, region.getRegionWidth(), region.getRegionHeight());
this(atlas, region.getWidth(), region.getHeight());
draw(region);
}
@@ -69,12 +69,12 @@ public class Image {
/**Draws a region at the center.*/
public void drawCenter(TextureRegion region){
draw(region, (width() - region.getRegionWidth())/2, (height() - region.getRegionHeight())/2, false, false);
draw(region, (width() - region.getWidth())/2, (height() - region.getHeight())/2, false, false);
}
/**Draws a region at the center.*/
public void drawCenter(TextureRegion region, boolean flipx, boolean flipy){
draw(region, (width() - region.getRegionWidth())/2, (height() - region.getRegionHeight())/2, flipx, flipy);
draw(region, (width() - region.getWidth())/2, (height() - region.getHeight())/2, flipx, flipy);
}
/**Draws an image at the top left corner.*/
@@ -108,12 +108,12 @@ public class Image {
graphics.drawImage(atlas,
x, y,
x + region.getRegionWidth(),
y + region.getRegionHeight(),
(flipx ? region.getRegionX() + region.getRegionWidth() : region.getRegionX()) + ofx,
(flipy ? region.getRegionY() + region.getRegionHeight() : region.getRegionY()) + ofy,
(flipx ? region.getRegionX() : region.getRegionX() + region.getRegionWidth()) + ofx,
(flipy ? region.getRegionY() : region.getRegionY() + region.getRegionHeight()) + ofy,
x + region.getWidth(),
y + region.getHeight(),
(flipx ? region.getRegionX() + region.getWidth() : region.getRegionX()) + ofx,
(flipy ? region.getRegionY() + region.getHeight() : region.getRegionY()) + ofy,
(flipx ? region.getRegionX() : region.getRegionX() + region.getWidth()) + ofx,
(flipy ? region.getRegionY() : region.getRegionY() + region.getHeight()) + ofy,
null);
}