summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-25 13:50:09 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-25 13:50:09 +0200
commitecb6ff15c24841dc08ab8f5c3b347c8080720ac4 (patch)
treed53db2a61a6151af970f9d27a617d12e0cac7588
parentbc210b2632891ca163d31fb57bc0c41769249bf5 (diff)
downloadhurrycurry-ecb6ff15c24841dc08ab8f5c3b347c8080720ac4.tar
hurrycurry-ecb6ff15c24841dc08ab8f5c3b347c8080720ac4.tar.bz2
hurrycurry-ecb6ff15c24841dc08ab8f5c3b347c8080720ac4.tar.zst
pc: main menu background
-rw-r--r--pixel-client/assets/misc.ini2
-rw-r--r--pixel-client/assets/textures/clouds.ta128
-rw-r--r--pixel-client/src/main.rs3
-rw-r--r--pixel-client/src/menu.rs52
-rw-r--r--pixel-client/src/render/font.rs5
-rw-r--r--pixel-client/src/render/misc.rs2
-rw-r--r--pixel-client/src/render/mod.rs9
-rw-r--r--pixel-client/src/render/sprite.rs10
-rw-r--r--pixel-client/src/ui.rs50
9 files changed, 252 insertions, 9 deletions
diff --git a/pixel-client/assets/misc.ini b/pixel-client/assets/misc.ini
index 59bd9132..19a4ba2f 100644
--- a/pixel-client/assets/misc.ini
+++ b/pixel-client/assets/misc.ini
@@ -13,3 +13,5 @@ conveyor-arrow=ew:conveyor_arrow_left
conveyor-arrow=we:conveyor_arrow_left~hflip
icon=pot_back,steak_in_pot~x4~y11,pot_front
+
+clouds=clouds
diff --git a/pixel-client/assets/textures/clouds.ta b/pixel-client/assets/textures/clouds.ta
new file mode 100644
index 00000000..f5b59c2b
--- /dev/null
+++ b/pixel-client/assets/textures/clouds.ta
@@ -0,0 +1,128 @@
+][[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]][[[[[[[[[[[[[[[[[[[[?[[[[[[[[[]]]]]]]]]]]]{{{{{{{{{]{{]]][[[[[[]]]{]]]]]]]]]]]]]]]]]}}}]]]]]]
+]][[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]][[[[[[[[[[[[[[[[[[????[[[[[[[[[]]]]]]]]]]{{}}}{{{{{{{{]]][[[[]]{{{]]]]]]]]]][[[[]]]}}}]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]][[[[[[[[[[[[[[[[[??????[[[[[[[[[]]]]]]]]{{}}}}}}{{{{{{{]]][[]]{{{{]]]]]]]]][[[[[[[]]]}}]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]][[[[[[[[[[[[[[[[[?????????????[[]]]]]]]{{{}}}}}}}{{{{{{]]]]]{{{{{{]]][[[[[[[[[[[[[[[[]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]][[[[[[[[[[[[[?[[??????????????[[]]]]]]{{{}}}}}}}}{{{{{{{]{{{{{{{]]][[[[[[[[[[[[[[[[[[]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]][[[]]]]]][[[[[[[[[[[[??????????????????[]]]]]]{{{}}}}{{{{{{{{{{{{{{{{{{]]][[[[[[[[[[[[[[[[[[[[]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]][[[[]]]]]]][[[[[[[[[[[[[????????????????[]]]]]]]{}}}}{{{{{{{{{{{{{{{{{{{]][[[[[[[[[[[[[[[[[[[[[]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]][[[]]]]]]]]]]][[[[[[[[[[[???????????????[[]]]]]]]]}}}{{{{{{{{{{{{{{{{{{{]]][[[[[[[[[[[[????????[[]]]]
+]]]]]]]]]]}]]]]{]]]]]]]]]]]]]]]]]]]{]{{]][[[[[[[[[[[[??????????????[]]]]]]]]]{}}{{{{{{{{{{{{{{{{{{]]][[[[[[[[[[[[?????????[[]]]]
+]]]]]]]]]]}}}}}{{{{{]]]]]]]]]]]]]]{{}{{{][[[[[[[[[[[??????????????[]]]]]]]]]{{}}{{{{{{{{{{{{{{{{{]]]][[[[[[[[[[???????????[[[[[[
+??]]]]}}}}}}}}}}{{{{{]]]]]]]]]]]]]{{}}}{][[[[[[[[[[[????????????[[[[]]]]{{{{{{}}}{{{{{{{{{{]]]]]]]]]][[[[[[[[[[???????????[[[[[[
+????]]}}}}}}}}}}{{{{{{]]]]]]]]]{{{{{{}}{][[[[[[[[[[[????????????[[[[[[[{{{{{{}}}}}{{{{{{{{]]]]]]]]]]]][[[[[[?[[???????????[[[[[?
+?????]]}}}}}}}}}}{{{{{{]]]]]]]{{{{{{{{{{][[[[[[[[[[[????????????[[[[[[[{{}}}}}}}}}}{{{{{]]]]]]]]]]]][[[[[[????????????????[[[???
+??????]]}}}}}}}}}}{{{{{]]]]]]{{{{{{{{{{]][[[[[[[[[[[[???????????[[[[[[[{{}}}}}}{{{{{{{{]]]]]]]]][[[[[[[?????????????????????????
+???????]]}}}}}}}}{{{{]]]]]]]{{{{{{{{{{]]]][[[[[[[[[[[[[[[[[??[[[[[[[[[{{{}}}}}{{{{{{]]]]]]]]]]]][[[[[???????????????????????????
+????????]]}}}}}}{{{]]]]]]]]]{{{{{{{{{{]]]]][[[[[[[[[[[[[[[[[[[[[[[[[[{{{{{}}}}{]]]]]]]]]]]]]]]][[[[[????????????????????????????
+?????????]]{}}}}{{]]]]]]]]]]{{{{{{{{]]]]]]][[[[[[[[[[[[[[[[[[[[[[{{{{{{{{{}}}}{]]]]]]]]]]]]]]][[[[[?????????????????????????????
+?????????]]{}}}}{{]]]]]]]]]]]{{{{{{]]]]]]]]]][[[[[[[[[[[[[[[[[[]]]]{{{{{{{{}}}{]]]]]]]]]]]]]][[[[[??????????????????????????????
+?????????]]]{}}}{{]]]]]]]]]]]]]]]]]]]]]]]]]]]]][[[[[[[[[[[[[[[[]]]]]]]{{{{{{{{]]]]]]]]]]]]]]][[[[???????????????????????????????
+?????????]]]{{}}{{]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]][[[[[[]]][[[]]]]]]]]{{{]]]]]]][]]]]]]]]]]][[[????????????????????????????????
+????????]]]]{{{{{]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]][[[[]]]]][[[]]]]]]]{{]]]]]]]][[]]]]]]]]]][[[????????????????????????????????
+????????]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]][[[]]{]][[[[]]]]]{{{]][[]][[[[[]]]]]]]]][[[????????????????????????????????
+????????]]][[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]{{]]]]][[]]{]][[[[[]]]{{{]]][[[[[[[[[]]]]]]]]]][[????????????????????????????????
+?????????[[[[[[[]][[[]]]]]]]]]]]]]]]{]]]]]{{{{{{{{]]]][[[]{]][[[[]]]{{}{{]]][[[[[[[[]]]]]]]]]][[[???????????????????????????????
+??????????[[[[[[[[[[]]]]]]]]]]]]]]]{{{{]{{{{{{{{{{{]]][[[]]]][[[]]]{{{}}{]]]]][[[[[]]]]]{]]]]]][[[[??[??????????????????????????
+???[[[[[[??[[[[[[[[[]]]]{{]]]{{{]]{{{{{{{{{{{{{{{{{]][[[[]]]][[]]]]{{}}}{]]]]]]]]]]]]]{{{{{{{{{[[[[[[[[[[???????????????????????
+??[[[[[[[??[[[[[[[[[]]]{{{{{{{{{{{{{{{{{{{{{{{{{{{]][[[[[[][[[[]]]{{{}}}{]]]]]]]]]]]]]{{{{{{{{{{[[[[[[[[[[[[????????????????????
+?[[[[[[[[??[[[[[[[[]]]{{{{{{{{{{{{{{{{{{{{{{{{{{]]]][[[[[[[[[[]]]{{{}}}{]]]]]]]]]]]]]]]{{{{{{{{{{[[[[[[[[[[[[[[[[???????????????
+??[[[[[[???[[[[[[[[]]]{{{{{{{{{{{{{{{{{{{{{{{{{]]]]]][[[[[]]]]]]]{{{}}{]]]]]]]]]]]]]]]]]{{{{{{{{{{{{[[[[[[[[[[[[[[[?????????????
+??????????]]][[[[[[]]]{{{{{{{{{{{{{{{{{{{{{{{{{]]]]]]][[[]]]]]]]]]{{{{]]]]]]]]]]]]]]]]]]{{{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[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]
+]]]]]][[[[]]]][[[??????????[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]{{{{{{{{{{{{{{{]]]]]]]]][[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]
+]]]]]][[[[]]][[[[?????????[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]{{{{{{{{{{{{{{]]]]]]]]][[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]
+]]]]]][[[[[[[[[[[????????[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]{{]]]]{{{{{{{{{{{{]]]]]]]]]][[[[[[[[[[[???[[[[[[[[[[[[[]]]]]]]][[[[[[[]]
+]]]]][[[[[[[[[[[[??????????[[????[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]{{{{{{{{{{{]]]][[[[[[[[[[[[[[[[??????[[[[[[[[[[[]]]][[[[[[[[[[[[[
+]]]][[[[[[[[[[[[[[????????????????[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]{{{{{{{{{{{][[[[[[[[[[[[[[[[[????????[[[[[[[[[[[[[[[[[[[[[[[[[[[
+]]][[[[[[[[[[[[[[??????????????????[[[[[[[[]]]]]]]]]]]]]]]]]]]{]]{{{{{{{{{{[[[[[[[[[[[[[??[[?????????[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[]][[[[[[??????[[???????????????????[[[[[[[]]]]]]]]]]]]]]]]]]]{{{{{{{{{{{{{[[[[[[[[[[[[??????????????[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[][[[[[????????????????????????????[[[[[[[[]]]]]]]]]]]]]]]]]]]{{{{{{{{{{{{[[[[[[[[[[[???????????????[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[]][[[[??????????????????????????[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]{{{{{{{{{{[[[[[[[[[[[[???????????????[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[]][[[[??????????????????????????[[[[[[[[[]]]]]][[[[]]]]]]]]]]]{{{{{]{{{{[[[[[[[[[[[[???????????????[[[[[[[[[[[[[[[[[[[[{{[[[[[
+[]][[[[[??????????????????????????[[[[[[[[[]]]][[[[[[[]]]]]]]]]]]]]]]]{{{{[[[[[[[[[[[???????????????[[[[[[[[[[[[[[[[[[[{{{{{{{[[
+[[[[[[[[??????????????????????????[[[[[[[[[]]]][[[[[[[[]]]]]]]]]]]]]]]]]]{[[[[[[[[[[[??????????????[[[[[[[[[[[[[[[[[[[[{{{{{{{[[
+[[[[[[[???[?????????????????????[[[[?????[[[]][[[[[[[[[]]]]]]]]]]]]]]]]]]][[[[[[[[[[[?????????????[[[[[[[[[[[[[[[[[[[[[[{{{{{{[[
+[[[[[[???[[[???????????????????[[[?????????[[][[[[[[[[[]]]]]]]]]]]]]]]]]]][[[[[[[[[[[?????????????[[[[[[[[[[[[[[[[[[[[[[[{{{{{{[
+[[[[[[???[[[[???????????[[????[[[???????????[]][[[[[[[[[]]]]]]]]]]]]]]]]]][[[[[[[[[[[[?????????????[[[[[[[[[[[[[[[[[[[[[[[{{{{{[
+[[[[[[[[[[[[[[?????????[[[??????????????????[[][[[[[[[[[]]]]]]]]]]]]]]]]]][[[[[[[[[[[[??????????????[[[[[[[[[[[[[[[[[[[[[[[{{{{[
+[[[[[[[[[[[[[[[?????????????????????????????[[][[[[[[[[[][[]]]]]]]]]]]]]]][[[[[[[[[[[[?????[[???[[?[[[[[[[[[[[[[[[[[[[[[[[[{{{{[
+[[[[[[[[[[[[[[[[???????????????????????????[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]][[[[[[[[[[[[????[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[{{{{[
+]][[[[[[[[[[[[[[[[[[[[[[?????????????????[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]{][[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[{{{{[
+]][[[[[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[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]{{{{]]]]]]]]]{]]]]]]{{{{{]]]]]]]]]]][[[[[[[[]]{{{{{{{{{{{{{{}}}{{{{
+{{{]]]][[[[]]]]]]][[[[[[[][[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]{{{]]]]]]]]{{{{{]]]{{{{{]]]]]]]]]]][[[[[[[]]{{}}}}{]]{{{{{{{{{{{{{
+{{{]]]]]]]]]]]]]]][[[[[]]]]]]]]]][[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]{{{{{{]]]]{{{{]]]]]]]]]]]][[[[[]]]{}}}}{]]{{{{{{{{{{{{{{
+{{{]]]]]]]]]]]]]]]][[[]]]]]]]]]]]][[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]{{{{{{{{{{{{{{{]]]]]]]]]]]]][[]]]]]{{}}{{]{{{{{{{{{{{{{{{
+{{{]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]][[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]{{{{{{{{{{{{{{{]]]]]]]]]]]]]]]]]]]]]{{{{]{{{{{{{{{{{{{{{{
+{{]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]][[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]{{{{{{{{{{{{]]]]]]]]]]]]]]]]]]]]]]]]]]]]]{{{{{{]{{{{{{{{{
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]][[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]{{{{{{{{{{{]]]]]]]]][[[]]]]]]]]]]]]]]]]{{{{{]]]]]{{{{{{{
diff --git a/pixel-client/src/main.rs b/pixel-client/src/main.rs
index 8c140fc5..b072a7e0 100644
--- a/pixel-client/src/main.rs
+++ b/pixel-client/src/main.rs
@@ -35,6 +35,7 @@ pub mod menu;
pub mod network;
pub mod render;
pub mod tilemap;
+pub mod ui;
#[derive(Debug, Parser)]
pub struct Args {
@@ -113,7 +114,7 @@ fn main() {
last_tick += dt;
- renderer.ui_scale = Vec2::new(5., 5.);
+ renderer.set_ui_view(5.);
match &mut state {
State::Ingame(x) => x.draw(&mut renderer),
State::Menu(x) => x.draw(&mut renderer),
diff --git a/pixel-client/src/menu.rs b/pixel-client/src/menu.rs
index 22a0244a..0d63d4e7 100644
--- a/pixel-client/src/menu.rs
+++ b/pixel-client/src/menu.rs
@@ -1,6 +1,7 @@
use crate::{
- render::{AtlasLayout, Renderer},
+ render::{sprite::SpriteDraw, AtlasLayout, Renderer},
tilemap::Tilemap,
+ ui::UiState,
};
use hurrycurry_protocol::{
glam::{IVec2, Vec2},
@@ -12,6 +13,9 @@ use sdl2::keyboard::KeyboardState;
#[derive(Debug)]
pub struct Menu {
map: Tilemap,
+ fade_in: f32,
+ ui_state: UiState,
+ background: Vec2,
}
impl Menu {
@@ -44,15 +48,53 @@ impl Menu {
}
}
- Self { map }
+ Self {
+ map,
+ fade_in: 0.,
+ ui_state: UiState::default(),
+ background: Vec2::ZERO,
+ }
+ }
+ pub fn tick(&mut self, dt: f32, _keyboard: &KeyboardState, _layout: &AtlasLayout) {
+ self.fade_in = (self.fade_in + dt).min(1.);
+ self.background += Vec2::new(2., 3.) * dt;
}
- pub fn tick(&mut self, _dt: f32, _keyboard: &KeyboardState, _layout: &AtlasLayout) {}
- pub fn draw(&self, ctx: &mut Renderer) {
+ pub fn draw(&mut self, ctx: &mut Renderer) {
ctx.set_world_view(
ctx.size / ctx.get_world_scale() * Vec2::new(0.8, 0.2),
ctx.size.max_element() / 32. / 15.,
);
+
+ for x in -1..=2 {
+ for y in -1..=2 {
+ ctx.draw_ui(SpriteDraw::underlay(
+ ctx.misc_textures.clouds,
+ Vec2::new(x as f32, y as f32) * 256. + self.background,
+ Vec2::ONE * 256.,
+ None,
+ ));
+ }
+ }
+ ctx.draw_ui(SpriteDraw::underlay(
+ ctx.misc_textures.solid,
+ Vec2::ZERO,
+ ctx.ui_size,
+ Some([0, 0, 0, 50]),
+ ));
+
self.map.draw(ctx);
- ctx.draw_text(Vec2::new(1., 1.), "Hello world!");
+
+ self.ui_state.draw(ctx, |ui| {
+ ui.button("Join");
+ ui.button("Settings");
+ ui.button("Quit");
+ });
+
+ ctx.draw_ui(SpriteDraw::overlay(
+ ctx.misc_textures.solid,
+ Vec2::ZERO,
+ ctx.ui_size,
+ Some([0, 0, 0, 255 - (self.fade_in * 255.) as u8]),
+ ));
}
}
diff --git a/pixel-client/src/render/font.rs b/pixel-client/src/render/font.rs
index ff4abade..392c1d66 100644
--- a/pixel-client/src/render/font.rs
+++ b/pixel-client/src/render/font.rs
@@ -25,8 +25,9 @@ impl FontTextures {
}
impl<'a> Renderer<'a> {
- pub fn draw_text(&mut self, position: Vec2, text: &str) {
+ pub fn draw_text(&mut self, position: Vec2, text: &str) -> Vec2 {
let mut cursor = position;
+ let mut line_height = 0f32;
for c in text.chars() {
if (c as u32) < 128 {
let r = self.font_textures.glyphs[c as usize];
@@ -37,7 +38,9 @@ impl<'a> Renderer<'a> {
None,
));
cursor.x += r.width() as f32;
+ line_height = line_height.max(r.height() as f32)
}
}
+ cursor + Vec2::Y * line_height
}
}
diff --git a/pixel-client/src/render/misc.rs b/pixel-client/src/render/misc.rs
index 05cde8e4..2197b89c 100644
--- a/pixel-client/src/render/misc.rs
+++ b/pixel-client/src/render/misc.rs
@@ -24,6 +24,7 @@ pub struct MiscTextures {
pub customer: Sprite,
pub interact_target: Sprite,
pub solid: Rect,
+ pub clouds: Rect,
}
impl MiscTextures {
@@ -37,6 +38,7 @@ impl MiscTextures {
10.,
),
solid: *layout.get("solid+a").unwrap(),
+ clouds: *layout.get("clouds+a").unwrap(),
}
}
}
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
}
diff --git a/pixel-client/src/render/sprite.rs b/pixel-client/src/render/sprite.rs
index 084e277e..292a99ab 100644
--- a/pixel-client/src/render/sprite.rs
+++ b/pixel-client/src/render/sprite.rs
@@ -65,14 +65,20 @@ pub struct SpriteDraw {
}
impl SpriteDraw {
- pub fn overlay(src: Rect, pos: Vec2, size: Vec2, tint: Option<[u8; 4]>) -> Self {
+ pub fn screen(src: Rect, z_order: i32, pos: Vec2, size: Vec2, tint: Option<[u8; 4]>) -> Self {
Self {
dst: FRect::new(pos.x, pos.y, size.x, size.y),
src,
tint: tint.unwrap_or([0xff; 4]),
- z_order: i32::MAX,
+ z_order,
}
}
+ pub fn overlay(src: Rect, pos: Vec2, size: Vec2, tint: Option<[u8; 4]>) -> Self {
+ SpriteDraw::screen(src, i32::MAX, pos, size, tint)
+ }
+ pub fn underlay(src: Rect, pos: Vec2, size: Vec2, tint: Option<[u8; 4]>) -> Self {
+ SpriteDraw::screen(src, i32::MIN, pos, size, tint)
+ }
pub fn alpha(mut self, alpha: f32) -> Self {
self.tint[3] = (alpha.clamp(0., 1.) * 255.) as u8;
self
diff --git a/pixel-client/src/ui.rs b/pixel-client/src/ui.rs
new file mode 100644
index 00000000..557800aa
--- /dev/null
+++ b/pixel-client/src/ui.rs
@@ -0,0 +1,50 @@
+use crate::render::Renderer;
+use hurrycurry_protocol::glam::Vec2;
+
+#[derive(Default, Debug)]
+pub struct UiState {
+ focus: usize,
+}
+
+pub struct Ui<'a, 'b> {
+ cursor: Vec2,
+ cross_height: f32,
+ direction_horizontal: bool,
+ renderer: &'a mut Renderer<'b>,
+ state: &'a mut UiState,
+}
+
+impl UiState {
+ pub fn draw(&mut self, renderer: &mut Renderer, ui: impl FnOnce(&mut Ui)) {
+ let mut u = Ui {
+ cursor: Vec2::ZERO,
+ direction_horizontal: false,
+ renderer,
+ state: self,
+ cross_height: 0.,
+ };
+ ui(&mut u);
+ }
+}
+
+impl<'a, 'b> Ui<'a, 'b> {
+ pub fn text(&mut self, text: &str) {
+ let size = self.renderer.draw_text(self.cursor, text);
+ self.advance(size);
+ }
+ pub fn button(&mut self, label: &str) -> bool {
+ let size = self.renderer.draw_text(self.cursor, label);
+ self.advance(size);
+ false
+ }
+
+ pub fn advance(&mut self, size: Vec2) {
+ if self.direction_horizontal {
+ self.cursor.x += size.x;
+ self.cross_height = self.cross_height.max(size.y);
+ } else {
+ self.cursor.y += size.y;
+ self.cross_height = self.cross_height.max(size.x);
+ }
+ }
+}