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; private static final float FLASH_INTERVAL = 0.05f;
//the amount the sprite is raised from flat when viewed in a raised perspective //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 //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) //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; private float dropInterval;
//the amount the sprite is raised from flat when viewed in a raised perspective //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 //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) //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( return new PointF(
cell % Dungeon.level.width() * csize + (csize - width()) * 0.5f, 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 ) { public void place( int p ) {
if (Dungeon.level != null) if (Dungeon.level != null) {
point( worldToCamera( p ) ); point(worldToCamera(p));
shadowOffset = 0.5f;
}
} }
public void drop() { public void drop() {

View File

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