diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-16 18:45:31 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-16 18:45:31 +0200 |
commit | 41aa862bd6753e9aedbf052a1299735ea1a63c48 (patch) | |
tree | 3f392f694146cacef0478cbe1046b40648b2250c | |
parent | 4064c56783bd78b96b0e79d5a7b15b1fb0d8edad (diff) | |
download | hurrycurry-41aa862bd6753e9aedbf052a1299735ea1a63c48.tar hurrycurry-41aa862bd6753e9aedbf052a1299735ea1a63c48.tar.bz2 hurrycurry-41aa862bd6753e9aedbf052a1299735ea1a63c48.tar.zst |
correct z-order finally
-rw-r--r-- | light-client/src/game.rs | 9 | ||||
-rw-r--r-- | light-client/src/render/mod.rs | 2 | ||||
-rw-r--r-- | light-client/src/render/sprite.rs | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/light-client/src/game.rs b/light-client/src/game.rs index ac5c3571..2692e6fc 100644 --- a/light-client/src/game.rs +++ b/light-client/src/game.rs @@ -86,10 +86,13 @@ impl Game { Sprite::new( renderer .metadata() - .get(&format!("{name}:a")) + .get(&format!("{name}+a")) .copied() - .unwrap_or(Rect::new(0, 0, 32, 24)), - Vec2::ZERO, + .unwrap_or_else(|| { + warn!("no sprite for item {name:?}"); + Rect::new(0, 0, 32, 24) + }), + Vec2::new(0., 0.0), 0.1, ) }) diff --git a/light-client/src/render/mod.rs b/light-client/src/render/mod.rs index fbf3d7a5..d5fba315 100644 --- a/light-client/src/render/mod.rs +++ b/light-client/src/render/mod.rs @@ -151,7 +151,7 @@ impl MiscTextures { player: Sprite::new( *renderer.metadata().get("player+a").unwrap(), Vec2::Y * 0.3, - 0., + 0.5 + 0.3, ), } } diff --git a/light-client/src/render/sprite.rs b/light-client/src/render/sprite.rs index c19f8392..b45e85b3 100644 --- a/light-client/src/render/sprite.rs +++ b/light-client/src/render/sprite.rs @@ -22,7 +22,7 @@ impl Sprite { } } pub fn new_tile(src: Rect) -> Self { - Self::new(src, Vec2::new(0.5, 1.0), 0.) + Self::new(src, Vec2::new(0.5, 1.0), 0.5) } pub fn at(&self, pos: Vec2) -> SpriteDraw { SpriteDraw { |