diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-21 18:45:11 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-21 22:17:54 +0200 |
commit | 64e00aad013da92d29851d3e8109a006b4dff8c5 (patch) | |
tree | 081e9a2829f3c247d48bf6468030f35c85b2db4f /pixel-client/src/game.rs | |
parent | b1eba76afaf7a506ff912634da6220db15d0023e (diff) | |
download | hurrycurry-64e00aad013da92d29851d3e8109a006b4dff8c5.tar hurrycurry-64e00aad013da92d29851d3e8109a006b4dff8c5.tar.bz2 hurrycurry-64e00aad013da92d29851d3e8109a006b4dff8c5.tar.zst |
pc: draw text
Diffstat (limited to 'pixel-client/src/game.rs')
-rw-r--r-- | pixel-client/src/game.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pixel-client/src/game.rs b/pixel-client/src/game.rs index 90711c48..c129f991 100644 --- a/pixel-client/src/game.rs +++ b/pixel-client/src/game.rs @@ -21,7 +21,7 @@ use crate::{ render::{ misc::MiscTextures, sprite::{Sprite, SpriteDraw}, - AtlasLayout, SpriteRenderer, + AtlasLayout, Renderer, }, tilemap::Tilemap, }; @@ -342,9 +342,9 @@ impl Game { } } - pub fn draw(&self, ctx: &mut SpriteRenderer) { - ctx.set_view( - -self.camera_center + (ctx.size / ctx.get_scale() / 2.), + pub fn draw(&self, ctx: &mut Renderer) { + ctx.set_world_view( + -self.camera_center + (ctx.size / ctx.get_world_scale() / 2.), ctx.size.min_element() / 32. / 10., ); @@ -381,7 +381,7 @@ impl Item { self.position.exp_to(self.parent_position, dt * 20.); self.alive.exp_to(alive, dt * 20.) } - pub fn draw(&self, ctx: &mut SpriteRenderer, item_sprites: &[Sprite], misc: &MiscTextures) { + pub fn draw(&self, ctx: &mut Renderer, item_sprites: &[Sprite], misc: &MiscTextures) { ctx.draw_world( item_sprites[self.kind.0] .at(self.position) |