diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-17 22:42:34 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-17 22:42:34 +0200 |
commit | db36af42d34e1af26d4f76a14f310eea367396f9 (patch) | |
tree | f9b15aa94690895d0d18778f63277e45f23a1360 /pixel-client/src/render | |
parent | 315864c63650c7b5d7dbb6efb53dea47c4610881 (diff) | |
download | hurrycurry-db36af42d34e1af26d4f76a14f310eea367396f9.tar hurrycurry-db36af42d34e1af26d4f76a14f310eea367396f9.tar.bz2 hurrycurry-db36af42d34e1af26d4f76a14f310eea367396f9.tar.zst |
show interact target
Diffstat (limited to 'pixel-client/src/render')
-rw-r--r-- | pixel-client/src/render/misc.rs | 6 | ||||
-rw-r--r-- | pixel-client/src/render/sprite.rs | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/pixel-client/src/render/misc.rs b/pixel-client/src/render/misc.rs index 5b9e43d4..c1f1295e 100644 --- a/pixel-client/src/render/misc.rs +++ b/pixel-client/src/render/misc.rs @@ -21,6 +21,7 @@ use sdl2::rect::Rect; pub struct MiscTextures { pub player: Sprite, + pub interact_target: Sprite, pub solid: Rect, } @@ -28,6 +29,11 @@ impl MiscTextures { pub fn init(layout: &AtlasLayout) -> Self { MiscTextures { player: Sprite::new(*layout.get("player+a").unwrap(), Vec2::Y * 0.3, 0.5 + 0.3), + interact_target: Sprite::new( + *layout.get("interact-target-thick+a").unwrap(), + Vec2::new(0.5, 1.0), + 10., + ), solid: *layout.get("solid+a").unwrap(), } } diff --git a/pixel-client/src/render/sprite.rs b/pixel-client/src/render/sprite.rs index 580146b1..4210b58d 100644 --- a/pixel-client/src/render/sprite.rs +++ b/pixel-client/src/render/sprite.rs @@ -77,6 +77,12 @@ impl SpriteDraw { self.tint[3] = (alpha.clamp(0., 1.) * 255.) as u8; self } + pub fn tint(mut self, r: u8, g: u8, b: u8) -> Self { + self.tint[0] = r; + self.tint[1] = g; + self.tint[2] = b; + self + } } impl Ord for SpriteDraw { |