v0.5.0: improved alignment for items and characters

This commit is contained in:
Evan Debenham 2017-01-23 23:45:36 -05:00
parent a992d2b8d2
commit 52ba8c2441
3 changed files with 18 additions and 7 deletions

View File

@ -67,7 +67,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
private static final float FLASH_INTERVAL = 0.05f;
//the amount the sprite is raised from flat when viewed in a raised perspective
protected float perspectiveRaise = 0.4f;
protected float perspectiveRaise = 0.375f; //6 pixels
//the width and height of the shadow are a percentage of sprite size
//offset is the number of pixels the shadow is moved down or up (handy for some animations)

View File

@ -62,7 +62,7 @@ public class ItemSprite extends MovieClip {
private float dropInterval;
//the amount the sprite is raised from flat when viewed in a raised perspective
protected float perspectiveRaise = 0.333f;
protected float perspectiveRaise = 0.3125f; //5 pixels
//the width and height of the shadow are a percentage of sprite size
//offset is the number of pixels the shadow is moved down or up (handy for some animations)
@ -130,13 +130,15 @@ public class ItemSprite extends MovieClip {
return new PointF(
cell % Dungeon.level.width() * csize + (csize - width()) * 0.5f,
cell / Dungeon.level.width() * csize + (csize - height()) - csize * 0.333f
cell / Dungeon.level.width() * csize + (csize - height()) - csize * perspectiveRaise
);
}
public void place( int p ) {
if (Dungeon.level != null)
point( worldToCamera( p ) );
if (Dungeon.level != null) {
point(worldToCamera(p));
shadowOffset = 0.5f;
}
}
public void drop() {

View File

@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.sprites;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.watabou.noosa.TextureFilm;
public class SpinnerSprite extends MobSprite {
@ -28,6 +29,8 @@ public class SpinnerSprite extends MobSprite {
public SpinnerSprite() {
super();
perspectiveRaise = 0f;
texture( Assets.SPINNER );
TextureFilm frames = new TextureFilm( texture, 16, 16 );
@ -47,6 +50,12 @@ public class SpinnerSprite extends MobSprite {
play( idle );
}
@Override
public void link(Char ch) {
super.link(ch);
renderShadow = false;
}
@Override
public int blood() {
return 0xFFBFE5B8;