aboutsummaryrefslogtreecommitdiff
path: root/pixel-client/src/render/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'pixel-client/src/render/mod.rs')
-rw-r--r--pixel-client/src/render/mod.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/pixel-client/src/render/mod.rs b/pixel-client/src/render/mod.rs
index 9b3132f9..74c282f3 100644
--- a/pixel-client/src/render/mod.rs
+++ b/pixel-client/src/render/mod.rs
@@ -21,6 +21,7 @@ pub mod sprite;
use font::FontTextures;
use hurrycurry_protocol::glam::Vec2;
+use misc::MiscTextures;
use sdl2::{
pixels::PixelFormatEnum,
rect::{FRect, Rect},
@@ -34,8 +35,10 @@ pub struct Renderer<'a> {
metadata: AtlasLayout,
font_textures: FontTextures,
+ pub misc_textures: MiscTextures,
pub size: Vec2,
+ pub ui_size: Vec2,
texture: Texture<'a>,
world_scale: Vec2,
@@ -109,6 +112,8 @@ impl<'a> Renderer<'a> {
Self {
ui_scale: Vec2::ZERO,
+ ui_size: Vec2::ZERO,
+ misc_textures: MiscTextures::init(&atlas_layout),
texture,
font_textures: FontTextures::init(&atlas_layout),
size: Vec2::ONE,
@@ -123,6 +128,10 @@ impl<'a> Renderer<'a> {
self.world_offset = offset;
self.world_scale = Vec2::new(32., 24.) * scale;
}
+ pub fn set_ui_view(&mut self, scale: f32) {
+ self.ui_scale = Vec2::splat(scale);
+ self.ui_size = self.size / self.ui_scale;
+ }
pub fn get_world_scale(&self) -> Vec2 {
self.world_scale
}