diff --git a/core/assets-raw/sprites/units/conquer-treads.png b/core/assets-raw/sprites/units/conquer-treads.png index 120fec69e9..3bc6677188 100644 Binary files a/core/assets-raw/sprites/units/conquer-treads.png and b/core/assets-raw/sprites/units/conquer-treads.png differ diff --git a/core/assets-raw/sprites/units/conquer.png b/core/assets-raw/sprites/units/conquer.png index d7f4c333eb..6d2d669ec1 100644 Binary files a/core/assets-raw/sprites/units/conquer.png and b/core/assets-raw/sprites/units/conquer.png differ diff --git a/core/assets-raw/sprites/units/sei.png b/core/assets-raw/sprites/units/sei.png index 01737b2654..122cd107ab 100644 Binary files a/core/assets-raw/sprites/units/sei.png and b/core/assets-raw/sprites/units/sei.png differ diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 0e7e7f5b31..e8f1d4d792 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -2460,7 +2460,7 @@ public class UnitTypes{ health = 800; armor = 5f; itemCapacity = 0; - treadRects = new Rect[]{new Rect(12, 7, 14, 51)}; + treadRects = new Rect[]{new Rect(12 - 32f, 7 - 32f, 14, 51)}; researchCostMultiplier = 0f; weapons.add(new Weapon("stell-weapon"){{ @@ -2501,7 +2501,7 @@ public class UnitTypes{ health = 2100; armor = 8f; itemCapacity = 0; - treadRects = new Rect[]{new Rect(17, 10, 19, 76)}; + treadRects = new Rect[]{new Rect(17 - 96f/2f, 10 - 96f/2f, 19, 76)}; researchCostMultiplier = 0f; weapons.add(new Weapon("locus-weapon"){{ @@ -2588,7 +2588,7 @@ public class UnitTypes{ health = 4500; armor = 10f; itemCapacity = 0; - treadRects = new Rect[]{new Rect(16, 38, 30, 75), new Rect(44, 7, 17, 60)}; + treadRects = new Rect[]{new Rect(16 - 60f, 38 - 60f, 30, 75), new Rect(44 - 60f, 7 - 60f, 17, 60)}; researchCostMultiplier = 0f; weapons.add(new Weapon("precept-weapon"){{ @@ -2654,8 +2654,7 @@ public class UnitTypes{ armor = 20f; itemCapacity = 0; crushDamage = 13f / 5f; - treadRects = new Rect[]{new Rect(22, 16, 28, 130)}; - + treadRects = new Rect[]{new Rect(22 - 154f/2f, 16 - 154f/2f, 28, 130)}; weapons.add(new Weapon("vanquish-weapon"){{ layerOffset = 0.0001f; @@ -2749,7 +2748,9 @@ public class UnitTypes{ armor = 25f; crushDamage = 25f / 5f; rotateSpeed = 0.8f; - treadRects = new Rect[]{new Rect(27, 152, 56, 73), new Rect(24, 51 - 9, 29, 17), new Rect(59, 18 - 9, 39, 19)}; + + float xo = 231f/2f, yo = 231f/2f; + treadRects = new Rect[]{new Rect(27 - xo, 152 - yo, 56, 73), new Rect(24 - xo, 51 - 9 - yo, 29, 17), new Rect(59 - xo, 18 - 9 - yo, 39, 19)}; weapons.add(new Weapon("conquer-weapon"){{ layerOffset = 0.1f; diff --git a/core/src/mindustry/entities/comp/TankComp.java b/core/src/mindustry/entities/comp/TankComp.java index 8982205da1..c1f1a90fd4 100644 --- a/core/src/mindustry/entities/comp/TankComp.java +++ b/core/src/mindustry/entities/comp/TankComp.java @@ -37,8 +37,8 @@ abstract class TankComp implements Posc, Flyingc, Hitboxc, Unitc, ElevationMovec //first rect should always be at the back var treadRect = type.treadRects[0]; - float xOffset = (treadRegion.width/2f - (treadRect.x + treadRect.width/2f)) / 4f; - float yOffset = (treadRegion.height/2f - (treadRect.y + treadRect.height/2f)) / 4f; + float xOffset = (-(treadRect.x + treadRect.width/2f)) / 4f; + float yOffset = (-(treadRect.y + treadRect.height/2f)) / 4f; for(int i : Mathf.signs){ Tmp.v1.set(xOffset * i, yOffset - treadRect.height / 2f / 4f).rotate(rotation - 90); diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index ee015ad2b6..f975ea0b96 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -362,7 +362,7 @@ public class UnitType extends UnlockableContent{ //TANK UNITS - /** list of treads as rectangles in IMAGE COORDINATES. these are mirrored, and should match the coordinates you see in an image editor. */ + /** list of treads as rectangles in IMAGE COORDINATES, relative to the center. these are mirrored. */ public Rect[] treadRects = {}; /** number of frames of movement in a tread */ public int treadFrames = 18; @@ -1303,8 +1303,8 @@ public class UnitType extends UnlockableContent{ for(int i = 0; i < treadRects.length; i ++){ var region = treadRegions[i][frame]; var treadRect = treadRects[i]; - float xOffset = treadRegion.width/2f - (treadRect.x + treadRect.width/2f); - float yOffset = treadRegion.height/2f - (treadRect.y + treadRect.height/2f); + float xOffset = -(treadRect.x + treadRect.width/2f); + float yOffset = -(treadRect.y + treadRect.height/2f); for(int side : Mathf.signs){ Tmp.v1.set(xOffset * side, yOffset).rotate(unit.rotation - 90); diff --git a/tools/src/mindustry/tools/Generators.java b/tools/src/mindustry/tools/Generators.java index d55f4227fe..2ffe36e4a6 100644 --- a/tools/src/mindustry/tools/Generators.java +++ b/tools/src/mindustry/tools/Generators.java @@ -530,7 +530,7 @@ public class Generators{ for(int r = 0; r < type.treadRects.length; r++){ Rect treadRect = type.treadRects[r]; //slice is always 1 pixel wide - Pixmap slice = pix.crop((int)treadRect.x, (int)treadRect.y, 1, (int)treadRect.height); + Pixmap slice = pix.crop((int)(treadRect.x + pix.width/2f), (int)(treadRect.y + pix.height/2f), 1, (int)treadRect.height); int frames = type.treadFrames; for(int i = 0; i < frames; i++){ int pullOffset = type.treadPullOffset;