v1.0.2: fixed sizes for various item sprite effects

This commit is contained in:
Evan Debenham 2021-08-28 15:55:13 -04:00
parent bb9ee6450f
commit 4458402f95
3 changed files with 15 additions and 10 deletions

View File

@ -27,7 +27,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.watabou.noosa.Game; import com.watabou.noosa.Game;
public class Enchanting extends ItemSprite { public class Enchanting extends ItemSprite {
private static final int SIZE = 16;
private enum Phase { private enum Phase {
FADE_IN, STATIC, FADE_OUT FADE_IN, STATIC, FADE_OUT
@ -62,8 +61,10 @@ public class Enchanting extends ItemSprite {
public void update() { public void update() {
super.update(); super.update();
x = target.sprite.center().x - SIZE / 2; if (passed == 0) {
y = target.sprite.y - SIZE; x = target.sprite.center().x - width() / 2;
y = target.sprite.y - height();
}
switch (phase) { switch (phase) {
case FADE_IN: case FADE_IN:

View File

@ -28,7 +28,6 @@ import com.watabou.noosa.Game;
import com.watabou.noosa.ui.Component; import com.watabou.noosa.ui.Component;
public class Transmuting extends Component { public class Transmuting extends Component {
private static final int SIZE = 16;
private enum Phase { private enum Phase {
FADE_IN, TRANSMUTING, FADE_OUT FADE_IN, TRANSMUTING, FADE_OUT
@ -69,8 +68,13 @@ public class Transmuting extends Component {
public void update() { public void update() {
super.update(); super.update();
oldSprite.x = newSprite.x = target.sprite.center().x - SIZE / 2; if (passed == 0) {
oldSprite.y = newSprite.y = target.sprite.y - SIZE; 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) { switch (phase) {
case FADE_IN: case FADE_IN:

View File

@ -424,11 +424,11 @@ public class Toolbar extends Component {
Point screen = Camera.main.cameraToScreen(tile.x, tile.y); Point screen = Camera.main.cameraToScreen(tile.x, tile.y);
PointF start = camera().screenToCamera(screen.x, screen.y); PointF start = camera().screenToCamera(screen.x, screen.y);
x = this.startX = start.x - ItemSprite.SIZE / 2; x = this.startX = start.x - width() / 2;
y = this.startY = start.y - ItemSprite.SIZE / 2; y = this.startY = start.y - width() / 2;
this.endX = endX - ItemSprite.SIZE / 2; this.endX = endX - width() / 2;
this.endY = endY - ItemSprite.SIZE / 2; this.endY = endY - width() / 2;
left = DURATION; left = DURATION;
scale.set( startScale = Camera.main.zoom / camera().zoom ); scale.set( startScale = Camera.main.zoom / camera().zoom );