Fixed #2735
This commit is contained in:
@@ -333,10 +333,11 @@ public class Generators{
|
||||
outliner.get(type.baseJointRegion);
|
||||
if(type.constructor.get() instanceof Legsc) outliner.get(type.legRegion);
|
||||
|
||||
Image image = ImagePacker.get(type.region);
|
||||
Image image = outline.get(ImagePacker.get(type.region));
|
||||
|
||||
outline.get(image).save(type.name + "-outline");
|
||||
image.save(type.name + "-outline");
|
||||
|
||||
//draw mech parts
|
||||
if(type.constructor.get() instanceof Mechc){
|
||||
image.drawCenter(type.baseRegion);
|
||||
image.drawCenter(type.legRegion);
|
||||
@@ -344,6 +345,19 @@ public class Generators{
|
||||
image.draw(type.region);
|
||||
}
|
||||
|
||||
//draw outlines
|
||||
for(Weapon weapon : type.weapons){
|
||||
weapon.load();
|
||||
|
||||
image.draw(outline.get(ImagePacker.get(weapon.region)),
|
||||
(int)(weapon.x / Draw.scl + image.width / 2f - weapon.region.width / 2f),
|
||||
(int)(-weapon.y / Draw.scl + image.height / 2f - weapon.region.height / 2f),
|
||||
weapon.flipSprite, false);
|
||||
}
|
||||
|
||||
//draw base region on top to mask weapons
|
||||
image.draw(type.region);
|
||||
|
||||
Image baseCell = ImagePacker.get(type.cellRegion);
|
||||
Image cell = new Image(type.cellRegion.width, type.cellRegion.height);
|
||||
cell.each((x, y) -> cell.draw(x, y, baseCell.getColor(x, y).mul(Color.valueOf("ffa665"))));
|
||||
@@ -353,7 +367,7 @@ public class Generators{
|
||||
for(Weapon weapon : type.weapons){
|
||||
weapon.load();
|
||||
|
||||
image.draw(weapon.region,
|
||||
image.draw(weapon.top ? outline.get(ImagePacker.get(weapon.region)) : ImagePacker.get(weapon.region),
|
||||
(int)(weapon.x / Draw.scl + image.width / 2f - weapon.region.width / 2f),
|
||||
(int)(-weapon.y / Draw.scl + image.height / 2f - weapon.region.height / 2f),
|
||||
weapon.flipSprite, false);
|
||||
|
||||
@@ -182,9 +182,14 @@ class Image{
|
||||
void draw(TextureRegion region, int x, int y, boolean flipx, boolean flipy){
|
||||
GenRegion.validate(region);
|
||||
|
||||
draw(ImagePacker.get(region), x, y, flipx, flipy);
|
||||
}
|
||||
|
||||
void draw(Image region, int x, int y, boolean flipx, boolean flipy){
|
||||
|
||||
int ofx = 0, ofy = 0;
|
||||
|
||||
graphics.drawImage(ImagePacker.get(region).image,
|
||||
graphics.drawImage(region.image,
|
||||
x, y,
|
||||
x + region.width,
|
||||
y + region.height,
|
||||
|
||||
Reference in New Issue
Block a user