Custom shadow offset (#4472)
This commit is contained in:
@@ -78,6 +78,7 @@ public class Turret extends ReloadTurret{
|
|||||||
|
|
||||||
public @Load(value = "@-base", fallback = "block-@size") TextureRegion baseRegion;
|
public @Load(value = "@-base", fallback = "block-@size") TextureRegion baseRegion;
|
||||||
public @Load("@-heat") TextureRegion heatRegion;
|
public @Load("@-heat") TextureRegion heatRegion;
|
||||||
|
public float elevation = -1f;
|
||||||
|
|
||||||
public Cons<TurretBuild> drawer = tile -> Draw.rect(region, tile.x + tr2.x, tile.y + tr2.y, tile.rotation - 90);
|
public Cons<TurretBuild> drawer = tile -> Draw.rect(region, tile.x + tr2.x, tile.y + tr2.y, tile.rotation - 90);
|
||||||
public Cons<TurretBuild> heatDrawer = tile -> {
|
public Cons<TurretBuild> heatDrawer = tile -> {
|
||||||
@@ -125,6 +126,7 @@ public class Turret extends ReloadTurret{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(shootLength < 0) shootLength = size * tilesize / 2f;
|
if(shootLength < 0) shootLength = size * tilesize / 2f;
|
||||||
|
if(elevation < 0) elevation = size / 2f;
|
||||||
|
|
||||||
super.init();
|
super.init();
|
||||||
}
|
}
|
||||||
@@ -234,7 +236,7 @@ public class Turret extends ReloadTurret{
|
|||||||
|
|
||||||
tr2.trns(rotation, -recoil);
|
tr2.trns(rotation, -recoil);
|
||||||
|
|
||||||
Drawf.shadow(region, x + tr2.x - (size / 2f), y + tr2.y - (size / 2f), rotation - 90);
|
Drawf.shadow(region, x + tr2.x - elevation, y + tr2.y - elevation, rotation - 90);
|
||||||
drawer.get(this);
|
drawer.get(this);
|
||||||
|
|
||||||
if(heatRegion != Core.atlas.find("error")){
|
if(heatRegion != Core.atlas.find("error")){
|
||||||
|
|||||||
Reference in New Issue
Block a user