From 1539d57f714da8f5d54ce158d5b88164c30afb12 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 29 Oct 2019 19:51:00 -0400 Subject: [PATCH] v0.8.0: fixed various errors with resized enemy sprites --- SPD-classes/src/main/java/com/watabou/noosa/Visual.java | 6 +++--- .../shatteredpixeldungeon/sprites/CharSprite.java | 8 ++++---- .../shatteredpixeldungeon/ui/TargetHealthIndicator.java | 2 +- .../shatteredpixeldungeon/windows/WndInfoMob.java | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/SPD-classes/src/main/java/com/watabou/noosa/Visual.java b/SPD-classes/src/main/java/com/watabou/noosa/Visual.java index a1787f0ce..c42112e47 100644 --- a/SPD-classes/src/main/java/com/watabou/noosa/Visual.java +++ b/SPD-classes/src/main/java/com/watabou/noosa/Visual.java @@ -138,12 +138,12 @@ public class Visual extends Gizmo { } public PointF center() { - return new PointF( x + width / 2, y + height / 2 ); + return new PointF( x + width() / 2, y + height() / 2 ); } public PointF center( PointF p ) { - x = p.x - width / 2; - y = p.y - height / 2; + x = p.x - width() / 2; + y = p.y - height() / 2; return p; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java index 6c4488581..45362ac3f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java @@ -166,8 +166,8 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip final int csize = DungeonTilemap.SIZE; return new PointF( - PixelScene.align(Camera.main, ((cell % Dungeon.level.width()) + 0.5f) * csize - width * 0.5f), - PixelScene.align(Camera.main, ((cell / Dungeon.level.width()) + 1.0f) * csize - height - csize * perspectiveRaise) + PixelScene.align(Camera.main, ((cell % Dungeon.level.width()) + 0.5f) * csize - width() * 0.5f), + PixelScene.align(Camera.main, ((cell / Dungeon.level.width()) + 1.0f) * csize - height() - csize * perspectiveRaise) ); } @@ -586,8 +586,8 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip super.updateMatrix(); Matrix.copy(matrix, shadowMatrix); Matrix.translate(shadowMatrix, - (width() * (1f - shadowWidth)) / 2f, - (height() * (1f - shadowHeight)) + shadowOffset); + (width * (1f - shadowWidth)) / 2f, + (height * (1f - shadowHeight)) + shadowOffset); Matrix.scale(shadowMatrix, shadowWidth, shadowHeight); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/TargetHealthIndicator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/TargetHealthIndicator.java index 7fac464ee..755462a1a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/TargetHealthIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/TargetHealthIndicator.java @@ -42,7 +42,7 @@ public class TargetHealthIndicator extends HealthBar { if (target != null && target.isAlive() && target.sprite.visible) { CharSprite sprite = target.sprite; - width = sprite.width; + width = sprite.width(); x = sprite.x; y = sprite.y - 3; level( target ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoMob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoMob.java index e16ad8c42..de6a1f883 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoMob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoMob.java @@ -68,14 +68,14 @@ public class WndInfoMob extends WndTitledMessage { protected void layout() { image.x = 0; - image.y = Math.max( 0, name.height() + health.height() - image.height ); + image.y = Math.max( 0, name.height() + health.height() - image.height() ); name.setPos(x + image.width + GAP, - image.height > name.height() ? y +(image.height() - name.height()) / 2 : y); + image.height() > name.height() ? y +(image.height() - name.height()) / 2 : y); - float w = width - image.width - GAP; + float w = width - image.width() - GAP; - health.setRect(image.width + GAP, name.bottom() + GAP, w, health.height()); + health.setRect(image.width() + GAP, name.bottom() + GAP, w, health.height()); buffs.setPos( name.right() + GAP-1,