diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-25 17:37:49 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-25 17:37:49 +0200 |
commit | 5bf5a200ada9ba03ca2a12c1503318a97166d7c7 (patch) | |
tree | 0936ea088efd11eaee00a88dcb368e7271fb985b /pixel-client/src/ui.rs | |
parent | 3403fc2d55f510c29bf7e74d85433801cd99cbbc (diff) | |
download | hurrycurry-5bf5a200ada9ba03ca2a12c1503318a97166d7c7.tar hurrycurry-5bf5a200ada9ba03ca2a12c1503318a97166d7c7.tar.bz2 hurrycurry-5bf5a200ada9ba03ca2a12c1503318a97166d7c7.tar.zst |
pc: show fps
Diffstat (limited to 'pixel-client/src/ui.rs')
-rw-r--r-- | pixel-client/src/ui.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/pixel-client/src/ui.rs b/pixel-client/src/ui.rs index 6410630f..684fb5b3 100644 --- a/pixel-client/src/ui.rs +++ b/pixel-client/src/ui.rs @@ -122,13 +122,19 @@ impl FocusDevice { impl<'a, 'b> Ui<'a, 'b> { pub fn text(&mut self, text: &str) { let margin = Vec2::splat(2.); - let size = margin + self.renderer.draw_text(self.cursor + margin, text) + margin; + let size = margin + + self + .renderer + .draw_text(self.cursor + margin, text, 1., None) + + margin; self.advance(size); } pub fn button(&mut self, w: f32, label: &str) -> bool { let c = self.cursor; let margin = Vec2::splat(4.); - let text_size = self.renderer.draw_text(self.cursor + margin, label); + let text_size = self + .renderer + .draw_text(self.cursor + margin, label, 1., None); let size = margin + Vec2::new(w, text_size.y) + margin; self.index += 1; @@ -170,7 +176,9 @@ impl<'a, 'b> Ui<'a, 'b> { pub fn textedit(&mut self, w: f32, content: &mut String) { let c = self.cursor; let margin = Vec2::splat(4.); - let text_size = self.renderer.draw_text(self.cursor + margin, &content); + let text_size = self + .renderer + .draw_text(self.cursor + margin, &content, 1., None); let size = margin + Vec2::new(w, text_size.y) + margin; self.index += 1; |