This commit is contained in:
Anuken
2019-03-02 23:06:14 -05:00
parent 4a4a9f267b
commit 89b439c3c8
12 changed files with 1168 additions and 1173 deletions

View File

@@ -147,10 +147,10 @@ public class Generators {
image.drawCenter(mech.region);
}
int off = (image.width() - mech.weapon.region.getWidth())/2;
int off = image.width()/2 - mech.weapon.region.getWidth()/2;
image.draw(mech.weapon.region, -(int)mech.weaponOffsetX + off, (int)mech.weaponOffsetY + off, false, false);
image.draw(mech.weapon.region, (int)mech.weaponOffsetX + off, (int)mech.weaponOffsetY + off, true, false);
image.draw(mech.weapon.region, -(int)mech.weaponOffsetX + off, (int)mech.weaponOffsetY + off + 4, false, false);
image.draw(mech.weapon.region, (int)mech.weaponOffsetX + off, (int)mech.weaponOffsetY + off + 4, true, false);
image.save("mech-icon-" + mech.name);

View File

@@ -101,21 +101,11 @@ class Image {
int ofx = 0, ofy = 0;
if(x < 0){
ofx = x;
x = 0;
}
if(y < 0){
ofy = y;
y = 0;
}
graphics.drawImage(ImagePacker.get(region).image,
x, y,
x + region.getWidth(),
y + region.getHeight(),
(flipx ? region.getWidth() : 0) + ofx,
(flipx ? region.getWidth() : 0) + ofx,
(flipy ? region.getHeight() : 0) + ofy,
(flipx ? 0 : region.getWidth()) + ofx,
(flipy ? 0 : region.getHeight()) + ofy,