From 4458402f95898384e1f00ebee8bd2634c93c8c15 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 28 Aug 2021 15:55:13 -0400 Subject: [PATCH] v1.0.2: fixed sizes for various item sprite effects --- .../shatteredpixeldungeon/effects/Enchanting.java | 7 ++++--- .../shatteredpixeldungeon/effects/Transmuting.java | 10 +++++++--- .../shatteredpixeldungeon/ui/Toolbar.java | 8 ++++---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Enchanting.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Enchanting.java index 2840a364b..e0ad4fa2c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Enchanting.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Enchanting.java @@ -27,7 +27,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.watabou.noosa.Game; public class Enchanting extends ItemSprite { - private static final int SIZE = 16; private enum Phase { FADE_IN, STATIC, FADE_OUT @@ -62,8 +61,10 @@ public class Enchanting extends ItemSprite { public void update() { super.update(); - x = target.sprite.center().x - SIZE / 2; - y = target.sprite.y - SIZE; + if (passed == 0) { + x = target.sprite.center().x - width() / 2; + y = target.sprite.y - height(); + } switch (phase) { case FADE_IN: diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Transmuting.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Transmuting.java index b8b8ad382..5d522b45d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Transmuting.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Transmuting.java @@ -28,7 +28,6 @@ import com.watabou.noosa.Game; import com.watabou.noosa.ui.Component; public class Transmuting extends Component { - private static final int SIZE = 16; private enum Phase { FADE_IN, TRANSMUTING, FADE_OUT @@ -69,8 +68,13 @@ public class Transmuting extends Component { public void update() { super.update(); - oldSprite.x = newSprite.x = target.sprite.center().x - SIZE / 2; - oldSprite.y = newSprite.y = target.sprite.y - SIZE; + if (passed == 0) { + oldSprite.x = target.sprite.center().x - oldSprite.width() / 2; + oldSprite.y = target.sprite.y - oldSprite.height(); + + newSprite.x = target.sprite.center().x - newSprite.width() / 2; + newSprite.y = target.sprite.y - newSprite.height(); + } switch (phase) { case FADE_IN: diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java index 67ce49993..f799cfddf 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java @@ -424,11 +424,11 @@ public class Toolbar extends Component { Point screen = Camera.main.cameraToScreen(tile.x, tile.y); PointF start = camera().screenToCamera(screen.x, screen.y); - x = this.startX = start.x - ItemSprite.SIZE / 2; - y = this.startY = start.y - ItemSprite.SIZE / 2; + x = this.startX = start.x - width() / 2; + y = this.startY = start.y - width() / 2; - this.endX = endX - ItemSprite.SIZE / 2; - this.endY = endY - ItemSprite.SIZE / 2; + this.endX = endX - width() / 2; + this.endY = endY - width() / 2; left = DURATION; scale.set( startScale = Camera.main.zoom / camera().zoom );