From fbd843808c7b06fa76544e5eccc3bda2ba62fc65 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Mon, 30 Jan 2023 10:43:32 +0200 Subject: [PATCH] feat(sdbclient): belly stylesheet --- sdbclient/assets/ui.ess | 39 +++++++++++++++++++++++++++++++++++++++ sdbclient/src/main.rs | 5 ++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 sdbclient/assets/ui.ess diff --git a/sdbclient/assets/ui.ess b/sdbclient/assets/ui.ess new file mode 100644 index 0000000..1d66f3b --- /dev/null +++ b/sdbclient/assets/ui.ess @@ -0,0 +1,39 @@ +/* default font size */ +* { + font: "fonts/FiraMono-Regular.ttf"; + font-size: 38px; +} + +.menu { + flex-direction: column; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; +} + +.menutitle { + font-size: 60px; + margin: 40px; + color: #E6E6E6; +} + +.menubutton { + width: 200px; + height: 65px; + margin: 20px; +} + +.menubutton .button-foreground { + background-color: #262626; + color: #E6E6E6; +} + +.menubutton:hover .button-foreground { + background-color: #404040; +} + +.menubutton:pressed .button-foreground { + background-color: #59BF59; +} + diff --git a/sdbclient/src/main.rs b/sdbclient/src/main.rs index 9f6d822..cc22adf 100644 --- a/sdbclient/src/main.rs +++ b/sdbclient/src/main.rs @@ -18,7 +18,7 @@ use bevy_mod_scripting::prelude::*; use iyes_loopless::prelude::*; -use belly::prelude::BellyPlugin; +use belly::prelude::{BellyPlugin, StyleSheet}; mod api; mod cfg; @@ -105,6 +105,9 @@ fn main() { fn setup(mut commands: Commands) { // Spawn a camera commands.spawn(Camera3dBundle::default()); + + // Load in a stylesheet for the UI + commands.add(StyleSheet::load("ui.ess")); } /// Utility function do despawn an entity and all its children -- 2.44.1