From a0c50a88c660059de96075a1351612c798ed33a3 Mon Sep 17 00:00:00 2001 From: "Elijah C. Voigt" Date: Thu, 18 Apr 2024 22:38:23 -0700 Subject: [PATCH] Slightly improved valid move indicator, title rendered text --- assets/images/title.png | 3 + assets/martian.tweak.toml | 80 +----- assets/models/Martian Chess.glb | 4 +- notes/camera-effects.txt | 73 ++++++ src/blogpost-animation-troubleshooting.md | 24 -- src/debug.rs | 45 ++-- src/display3d.rs | 290 ++++------------------ src/game.rs | 2 +- src/menu.rs | 57 +++-- 9 files changed, 183 insertions(+), 395 deletions(-) create mode 100644 assets/images/title.png create mode 100644 notes/camera-effects.txt delete mode 100644 src/blogpost-animation-troubleshooting.md diff --git a/assets/images/title.png b/assets/images/title.png new file mode 100644 index 0000000..9c3791b --- /dev/null +++ b/assets/images/title.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1062a2d4df9a58a543f7d6215ca7aba86bb36fa2c0c325c83e1dd1f64c0f3323 +size 822327 diff --git a/assets/martian.tweak.toml b/assets/martian.tweak.toml index d0f71f7..e5792d5 100644 --- a/assets/martian.tweak.toml +++ b/assets/martian.tweak.toml @@ -150,33 +150,11 @@ invalid = "/sfx/3D/3DInvalidMove" #################### # Display3d settings #################### -[display3d] -### -# Multi-sample Anti-Aliasing -# https://docs.rs/bevy/0.11.3/bevy/prelude/enum.Msaa.html -# Options: Off, Sample2, Sample4, Sample8 -# Requires: display3d.ssoa.quality_level = "Off" -### -msaa = "Sample8" - -### -# Enable HDR lighting -### -hdr = true - -### -# Screen Space Ambient Occlusion -# https://docs.rs/bevy/0.11.3/bevy/pbr/enum.ScreenSpaceAmbientOcclusionQualityLevel.html -# Options: Off, Low, Medium, High, Ultra -# Requires: display3d.msaa = "Off" -### -ssoa.quality_level = "Off" - [display3d.skybox] -brightness = 100.0 +brightness = 500.0 [display3d.environment_map_light] -intensity = 1.0 +intensity = 2500.0 [display3d.models] assets_file = "models/Martian Chess.glb" @@ -190,9 +168,13 @@ queen_blue = "QueenBlue" drone_blue = "DroneBlue" pawn_blue = "PawnBlue" board = "Gameboard" -valid_move = "Valid Move Spot" +valid_move = "Valid Move Static" title = "Title" +[title] +image = "images/title.png" +width_px = 400.0 + [display3d.models.animations] intro_a = "GameCamIntro1" intro_b = "GameCamIntro2" @@ -221,50 +203,4 @@ pawn_red = "PawnRedPieceIdle" drone_blue = "DroneBluePieceIdle" drone_red = "DroneRedPieceIdle" queen_blue = "QueenBluePieceIdle" -queen_red = "QueenRedPieceIdle" - -### -# Fog -# Only seems to affect objects and not skyboxes -### -[display3d.fog] -directional_light_exponent = 1.0 -[display3d.fog.color] -Rgba = { red = 0.0, green = 0.0, blue = 0.0, alpha = 1.0 } -[display3d.fog.directional_light_color] -Rgba = { red = 0.0, green = 0.0, blue = 0.0, alpha = 1.0 } -### -# Fog Faloff -# https://docs.rs/bevy/0.11.3/bevy/pbr/enum.FogFalloff.html -### -[display3d.fog.falloff] -Atmospheric = { extinction = [0.0, 0.0, 0.0], inscattering = [0.0, 0.0, 0.0] } -# Examples: -# * Linear = { start = 1.0, end = 10.0 } -# * Exponential = { density = 1.0 } -# * ExponentialSquared = { density = 1.0 } -# * Atmospheric = { extinction = [1.0, 1.0, 1.0], inscattering = [1.0, 1.0, 1.0] } - -### -# Display 3D Coloring -### -[display3d.color] -### -# Tonemapping -# https://docs.rs/bevy/0.11.3/bevy/core_pipeline/tonemapping/enum.Tonemapping.html -# Options: None, Reinhard, ReinhardLuminance, AcesFitted, AgX, SomewhatBoringDisplayTransform, TonyMcMapface, BlenderFilmic -### -tonemapping = "BlenderFilmic" - -### -# Color grading -# https://docs.rs/bevy/0.11.3/bevy/render/view/struct.ColorGrading.html -### -[display3d.color.grading] -exposure = 1.0 -gamma = 1.0 -pre_saturation = 1.0 -post_saturation = 1.0 - -[display3d.bloom] -intensity = 0.0 \ No newline at end of file +queen_red = "QueenRedPieceIdle" \ No newline at end of file diff --git a/assets/models/Martian Chess.glb b/assets/models/Martian Chess.glb index cc542a5..da36a8c 100644 --- a/assets/models/Martian Chess.glb +++ b/assets/models/Martian Chess.glb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f42782476e71492478366b77ebe1c7b4880c10e1774cf605d5b3231d9b90a3a0 -size 56198208 +oid sha256:d20f5dcde3c995a7a0540ee38887effce190b9954b820eb9663846d08fd6d06b +size 33877448 diff --git a/notes/camera-effects.txt b/notes/camera-effects.txt new file mode 100644 index 0000000..4672990 --- /dev/null +++ b/notes/camera-effects.txt @@ -0,0 +1,73 @@ +Bevy Anti Aliasing and Screen Effects + +TAA: Temporal Anti Aliasing (https://docs.rs/bevy/0.13.2/bevy/core_pipeline/experimental/taa/struct.TemporalAntiAliasSettings.html) +* Component added to camera +* Conflicts with MSAA and FXAA +* Can be "reset" with a bool, but otherwise no settings +* Requires TemporalAntiAliasingPlugin to App. +* Requires the following marker components on Camera: + * DepthPrepass + * MotionVectorPrepass + * TemporalJitter +* Cannot be used with Orthographic camera + +MSAA: Multi-Sample Anti-Aliasing (https://docs.rs/bevy/0.13.2/bevy/prelude/enum.Msaa.html) +* Resource set to the number of samples to run for anti-aliasing or "Off" +* Conflicts with FXAA and TAA +* If set to a sample count, conflicts with Msaa and Fxaa + +FXAA: Fast Approximate Anti-Aliasing (https://docs.rs/bevy/0.13.2/bevy/core_pipeline/fxaa/struct.Fxaa.html) +* Compnent added to Camera +* Conflicts with MSAA and TAA +* Has the following parameters: + * Enabled + * Edge Threshold and Edge Threshold Min. + * Sensitivity settings ranging from Low to Extreme. + +CAS: Contrast Adaptive Sharpening (https://docs.rs/bevy/0.13.2/bevy/core_pipeline/contrast_adaptive_sharpening/struct.ContrastAdaptiveSharpeningSettings.html) +* Component put on camera to enable adaptive sharpening +* Used in combination w/ FXAA or TAA +* Has the following parameters: + * Enabled (bool) + * Sharpening Strength (float 0..1 | default 0.6) + * Denoise (bool) + +HDR: High Dynamic Range (https://docs.rs/bevy/0.13.2/bevy/prelude/struct.Camera.html#structfield.hdr) +* Boolean on Camera component + +Bloom (https://docs.rs/bevy/0.13.2/bevy/core_pipeline/bloom/struct.BloomSettings.html) +* Component added to camera to configure bloom effects +* Requires HDR to be enabled +* settings: + * Intensity + * Composite Mode: Additive or EnergyConserving + * low_frequency_boost[_curvature]: Likelyhood light will scatter completely sideways + * high_pass_frequency: 0..1 -> scatter angle 0..90 + * Bloom Prefilter: + * Threshold: rgb values under this will not contribute to bloom + * How much to blend between threshold and non-threshold values + * 0..1 -> abrupt..fully soft + * range 0..1, default 0.0 + +Tonemapping (https://docs.rs/bevy/0.13.2/bevy/core_pipeline/tonemapping/enum.Tonemapping.html) +* Component added to camera to configure color tonemapping +* Enum of options with no further configuration + +Color Grading (https://docs.rs/bevy/0.13.2/bevy/render/view/struct.ColorGrading.html) +* Component added to camera to control color grading +* Settings: + * Exposure offset measured in stops + * Gamma applied before tonemapping + * pre/post saturation: range 0..1, saturation before/after tonemapping + +Fog (https://docs.rs/bevy/0.13.2/bevy/pbr/struct.FogSettings.html) +* Component added to camera +* Settings: + * Color of the Fog + * Directional light of the fog + * Directional light exponent + * Fog Falloff + * Linear, Exponential, ExponentialSquared, Atmospheric + +SSAO: Screen Space Ambient Occlusion (https://docs.rs/bevy/0.13.2/bevy/pbr/struct.ScreenSpaceAmbientOcclusionBundle.html) +* Components put on camera to configure SSAO \ No newline at end of file diff --git a/src/blogpost-animation-troubleshooting.md b/src/blogpost-animation-troubleshooting.md deleted file mode 100644 index d57ddfc..0000000 --- a/src/blogpost-animation-troubleshooting.md +++ /dev/null @@ -1,24 +0,0 @@ -# Debugging animations not working? - -OK so seems like this: -https://github.com/bevyengine/bevy/blob/22e39c4abf6e2fdf99ba0820b3c35db73be71347/crates/bevy_animation/src/lib.rs#L119C12-L122 - -Printed as this: - -``` - paths: { - EntityPath { - parts: [ - "Queen", - ], - }: 0, - }, -``` - -Means the only entity that this will play for is one called "Queen". - -Now there are a few hacks we can do. -We can add the `Name("Queen")` to all of our entities but that's BS. -They aren't Queens they are Pawns and Drones. - -So why does Bevy think the animation is only associated with Queen and not other entities? \ No newline at end of file diff --git a/src/debug.rs b/src/debug.rs index f9b6aaf..2d3cb2d 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -10,10 +10,7 @@ impl Plugin for DebugPlugin { SystemInformationDiagnosticsPlugin, )) .init_resource::() - // .insert_resource(GizmoConfig { - // depth_bias: -0.1, - // ..default() - // }) + .init_state::() .add_systems(Update, (aabb_gizmo,)) // Systems that run in the editor mode .add_systems( @@ -22,15 +19,15 @@ impl Plugin for DebugPlugin { selected_gizmo.run_if(any_with_component::), selected_position.run_if(any_with_component::), ) - .run_if(resource_exists::), + .run_if(in_state(DebugState::Enabled)), ) .add_systems(Startup, init_debug_ui) .add_systems( Update, ( toggle_debug_mode.run_if(on_event::()), - display_diagnostics.run_if(resource_exists::), - toggle_debug_ui.run_if(resource_changed_or_removed::()), + display_diagnostics.run_if(in_state(DebugState::Enabled)), + toggle_debug_ui.run_if(state_changed::), ), ); } @@ -58,16 +55,20 @@ impl DebugInfo { } /// Marker resource used to enable Debug mode when present -#[derive(Debug, Resource, Default)] -pub(crate) struct DebugEnabled; +#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, Default, States)] +pub(crate) enum DebugState { + #[default] + Disabled, + Enabled, +} #[derive(Debug, Component)] struct DebugRoot; fn toggle_debug_mode( mut events: EventReader, - enabled: Option>, - mut commands: Commands, + current_state: Res>, + mut next_state: ResMut>, ) { events .read() @@ -76,20 +77,20 @@ fn toggle_debug_mode( state, key_code, .. }| *state == ButtonState::Pressed && *key_code == KeyCode::F3, ) - .for_each(|_| match enabled { - Some(_) => commands.remove_resource::(), - None => commands.insert_resource(DebugEnabled), + .for_each(|_| match current_state.get() { + DebugState::Enabled => next_state.set(DebugState::Disabled), + DebugState::Disabled => next_state.set(DebugState::Enabled), }); } fn toggle_debug_ui( mut visibility: Query<&mut Visibility, With>, - enabled: Option>, + current_state: Res>, ) { visibility.iter_mut().for_each(|mut vis| { - *vis = match enabled { - Some(_) => Visibility::Visible, - None => Visibility::Hidden, + *vis = match current_state.get() { + DebugState::Enabled => Visibility::Visible, + DebugState::Disabled => Visibility::Hidden, } }); } @@ -145,7 +146,7 @@ fn aabb_gizmo( added: Query>, mut removed: RemovedComponents, selected: Query>, - active: Option>, + current_state: Res>, mut commands: Commands, ) { added.iter().for_each(|e| { @@ -156,13 +157,13 @@ fn aabb_gizmo( removed.read().for_each(|e| { commands.entity(e).remove::(); }); - match active { - Some(_) => selected.iter().for_each(|e| { + match current_state.get() { + DebugState::Enabled => selected.iter().for_each(|e| { commands.entity(e).insert(ShowAabbGizmo { color: Some(Color::RED), }); }), - None => selected.iter().for_each(|e| { + DebugState::Disabled => selected.iter().for_each(|e| { commands.entity(e).remove::(); }), } diff --git a/src/display3d.rs b/src/display3d.rs index f008e9a..f1d0450 100644 --- a/src/display3d.rs +++ b/src/display3d.rs @@ -1,3 +1,7 @@ +use bevy::core_pipeline::{ + bloom::{BloomCompositeMode, BloomPrefilterSettings}, contrast_adaptive_sharpening::ContrastAdaptiveSharpeningSettings, experimental::taa::TemporalAntiAliasBundle, fxaa::{Fxaa, FxaaPlugin, Sensitivity} +}; + use crate::prelude::*; pub(crate) struct Display3dPlugin; @@ -9,6 +13,10 @@ impl Plugin for Display3dPlugin { MaterialPlugin::::default(), )) .insert_resource(Msaa::Off) + .insert_resource(AmbientLight { + color: Color::WHITE, + brightness: 100.0, + }) .add_systems( OnExit(GameState::Loading), ( @@ -72,7 +80,7 @@ impl Plugin for Display3dPlugin { moves_gizmo, debug_selected.run_if(any_with_component::), ) - .run_if(resource_exists::) + .run_if(in_state(debug::DebugState::Enabled)) .run_if(in_state(GameState::Play)) .run_if(in_state(DisplayState::Display3d)), ) @@ -273,10 +281,7 @@ fn hydrate_camera( let environment_map_intensity = tweak .get::("display3d_environment_map_light_intensity") .unwrap(); - let fog_settings = tweak - .get::("display3d_fog") - .unwrap() - .into(); + info!("Hydrating camera {:?}", entity); // Populate the components for the camera commands.entity(entity).insert(( @@ -285,14 +290,14 @@ fn hydrate_camera( Camera3dBundle { camera: Camera { is_active: true, - hdr: tweak.get::("display3d_hdr").unwrap(), + hdr: true, ..default() }, dither: DebandDither::Enabled, color_grading: ColorGrading { ..default() }, + tonemapping: Tonemapping::BlenderFilmic, ..default() }, - BloomSettings { ..default() }, Skybox { image: skybox_handle.clone(), brightness: skybox_brightness, @@ -302,10 +307,31 @@ fn hydrate_camera( specular_map: skybox_handle.clone(), intensity: environment_map_intensity, }, - FogSettings { ..fog_settings }, - ScreenSpaceAmbientOcclusionBundle { ..default() }, - TemporalAntiAliasSettings { ..default() }, - MotionVectorPrepass, + Fxaa { + enabled: true, + ..default() + }, + ContrastAdaptiveSharpeningSettings { + enabled: false, + ..default() + }, + BloomSettings { + intensity: 0.05, + prefilter_settings: BloomPrefilterSettings { + threshold: 0.8, + threshold_softness: 0.5, + }, + composite_mode: BloomCompositeMode::Additive, + ..default() + }, + FogSettings { + color: Color::rgba(0.25, 0.25, 0.25, 1.0), + falloff: FogFalloff::Exponential { + density: 0.025, + }, + ..default() + }, + // ScreenSpaceAmbientOcclusionBundle { ..default() }, )); let assets_handle = tweak @@ -339,81 +365,21 @@ fn hydrate_camera( /// Update display3d tweaks in the game /// Triggered on entering 3d state and when the tweakfile is updated. fn update_tweaks( - mut camera_settings: Query< - ( - Entity, - &mut FogSettings, - &mut ColorGrading, - &mut Tonemapping, - &mut BloomSettings, - &mut Skybox, - &mut EnvironmentMapLight, - ), - With, - >, + mut camera_settings: Query<(Entity, &mut Skybox, &mut EnvironmentMapLight), With>, tweaks_file: Res, tweaks: Res>, mut commands: Commands, ) { if let Some(tweak) = tweaks.get(tweaks_file.handle.clone()) { warn!("Updating tweaks!"); - camera_settings.iter_mut().for_each( - |( - entity, - mut fog, - mut color_grading, - mut tonemapping, - mut bloom, - mut skybox, - mut environment_map_light, - )| { - *fog = tweak - .get::("display3d_fog") - .unwrap() - .into(); - *color_grading = tweak - .get::("display3d_color_grading") - .unwrap() - .into(); - *tonemapping = tweak - .get::("display3d_color_tonemapping") - .unwrap() - .into(); - *bloom = tweak - .get::("display3d_bloom") - .unwrap() - .into(); + camera_settings + .iter_mut() + .for_each(|(entity, mut skybox, mut environment_map_light)| { skybox.brightness = tweak.get::("display3d_skybox_brightness").unwrap(); environment_map_light.intensity = tweak .get::("display3d_environment_map_light_intensity") .unwrap(); - - let quality_level = tweak - .get::( - "display3d_ssao_quality_level", - ); - match quality_level { - Some(quality_level) => { - commands - .entity(entity) - .insert(ScreenSpaceAmbientOcclusionSettings { - quality_level: quality_level.into(), - }); - commands.insert_resource(Msaa::Off); - } - None => { - commands - .entity(entity) - .remove::(); - let msaa: Msaa = tweak - .get::("display3d_msaa") - .unwrap() - .into(); - commands.insert_resource(msaa); - } - } - }, - ); + }); } } @@ -1000,178 +966,6 @@ fn switch_sides( }); } -pub(super) mod tweaks { - use super::*; - - #[derive(Debug, Deserialize)] - pub enum TweakTonemapping { - None, - Reinhard, - ReinhardLuminance, - AcesFitted, - AgX, - SomewhatBoringDisplayTransform, - TonyMcMapface, - BlenderFilmic, - } - - impl From for Tonemapping { - fn from(src: TweakTonemapping) -> Tonemapping { - match src { - TweakTonemapping::None => Tonemapping::None, - TweakTonemapping::Reinhard => Tonemapping::Reinhard, - TweakTonemapping::ReinhardLuminance => Tonemapping::ReinhardLuminance, - TweakTonemapping::AcesFitted => Tonemapping::AcesFitted, - TweakTonemapping::AgX => Tonemapping::AgX, - TweakTonemapping::SomewhatBoringDisplayTransform => { - Tonemapping::SomewhatBoringDisplayTransform - } - TweakTonemapping::TonyMcMapface => Tonemapping::TonyMcMapface, - TweakTonemapping::BlenderFilmic => Tonemapping::BlenderFilmic, - } - } - } - - #[derive(Debug, Deserialize)] - pub struct TweakBloomSettings { - intensity: f32, - } - - impl From for BloomSettings { - fn from(src: TweakBloomSettings) -> BloomSettings { - BloomSettings { - intensity: src.intensity, - ..default() - } - } - } - - #[derive(Debug, Deserialize)] - pub enum TweakMsaa { - Off, - Sample2, - Sample4, - Sample8, - } - - impl From for Msaa { - fn from(src: TweakMsaa) -> Msaa { - match src { - TweakMsaa::Off => Msaa::Off, - TweakMsaa::Sample2 => Msaa::Sample2, - TweakMsaa::Sample4 => Msaa::Sample4, - TweakMsaa::Sample8 => Msaa::Sample8, - } - } - } - - #[derive(Deserialize, Debug)] - pub enum TweakScreenSpaceAmbientOcclusionQualityLevel { - Low, - Medium, - High, - Ultra, - } - - impl From - for ScreenSpaceAmbientOcclusionQualityLevel - { - fn from( - src: TweakScreenSpaceAmbientOcclusionQualityLevel, - ) -> ScreenSpaceAmbientOcclusionQualityLevel { - match src { - TweakScreenSpaceAmbientOcclusionQualityLevel::Low => { - ScreenSpaceAmbientOcclusionQualityLevel::Low - } - TweakScreenSpaceAmbientOcclusionQualityLevel::Medium => { - ScreenSpaceAmbientOcclusionQualityLevel::Medium - } - TweakScreenSpaceAmbientOcclusionQualityLevel::High => { - ScreenSpaceAmbientOcclusionQualityLevel::High - } - TweakScreenSpaceAmbientOcclusionQualityLevel::Ultra => { - ScreenSpaceAmbientOcclusionQualityLevel::Ultra - } - } - } - } - - #[derive(Debug, Deserialize)] - pub struct TweakFogSettings { - pub color: Color, - pub directional_light_color: Color, - pub directional_light_exponent: f32, - pub falloff: TweakFogFalloff, - } - - impl From for FogSettings { - fn from(src: TweakFogSettings) -> FogSettings { - FogSettings { - color: src.color, - directional_light_color: src.directional_light_color, - directional_light_exponent: src.directional_light_exponent, - falloff: src.falloff.into(), - } - } - } - - #[derive(Debug, Deserialize)] - pub enum TweakFogFalloff { - Linear { - start: f32, - end: f32, - }, - Exponential { - density: f32, - }, - ExponentialSquared { - density: f32, - }, - Atmospheric { - extinction: Vec3, - inscattering: Vec3, - }, - } - - impl From for FogFalloff { - fn from(src: TweakFogFalloff) -> FogFalloff { - match src { - TweakFogFalloff::Linear { start, end } => FogFalloff::Linear { start, end }, - TweakFogFalloff::Exponential { density } => FogFalloff::Exponential { density }, - TweakFogFalloff::ExponentialSquared { density } => { - FogFalloff::ExponentialSquared { density } - } - TweakFogFalloff::Atmospheric { - extinction, - inscattering, - } => FogFalloff::Atmospheric { - extinction, - inscattering, - }, - } - } - } - - #[derive(Debug, Deserialize)] - pub struct TweakColorGrading { - pub exposure: f32, - pub gamma: f32, - pub pre_saturation: f32, - pub post_saturation: f32, - } - - impl From for ColorGrading { - fn from(src: TweakColorGrading) -> ColorGrading { - ColorGrading { - exposure: src.exposure, - gamma: src.gamma, - pre_saturation: src.pre_saturation, - post_saturation: src.post_saturation, - } - } - } -} - /// Type expressing the extended material of standardMaterial + dissolveMaterial type DissolveMaterial = ExtendedMaterial; diff --git a/src/game.rs b/src/game.rs index e684567..b8b261f 100644 --- a/src/game.rs +++ b/src/game.rs @@ -40,7 +40,7 @@ impl Plugin for GamePlugin { ) .add_systems( PostUpdate, - (debug_board.run_if(resource_exists::),), + (debug_board.run_if(in_state(debug::DebugState::Enabled)),), ) .add_systems(OnEnter(GameState::Restart), handle_restart) .add_systems(OnEnter(GameState::Quit), handle_quit); diff --git a/src/menu.rs b/src/menu.rs index c2b7ce0..b2a7c59 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -49,6 +49,8 @@ fn init_play_menu( let tweak = tweaks.get(tweaks_file.handle.clone()).expect("Load tweaks"); let button_handle = tweak.get_handle::("buttons_image_resting").unwrap(); let font_handle = tweak.get_handle::("buttons_font").unwrap(); + let title_handle = tweak.get_handle::("title_image").unwrap(); + let title_width_px = tweak.get::("title_width_px").unwrap(); commands .spawn(( @@ -70,14 +72,17 @@ fn init_play_menu( )) .with_children(|parent| { // Title - parent.spawn((TextBundle::from_section( - "M A R T I A N C H E S S", - TextStyle { - font_size: 48.0, - color: Color::ORANGE_RED, + parent.spawn(ImageBundle { + style: Style { + width: Val::Px(title_width_px), + ..default() + }, + image: UiImage { + texture: title_handle.clone(), ..default() }, - ),)); + ..default() + }); // Continue button parent @@ -86,8 +91,8 @@ fn init_play_menu( ButtonAction(MenuState::Off), ButtonBundle { style: Style { - padding: UiRect::all(Val::Px(5.0)), - margin: UiRect::all(Val::Px(5.0)), + padding: UiRect::all(Val::Px(2.0)), + margin: UiRect::all(Val::Px(2.0)), ..default() }, image: UiImage { @@ -104,14 +109,14 @@ fn init_play_menu( value: "C o n t i n u e".into(), style: TextStyle { color: Color::WHITE, - font_size: 16.0, + font_size: 12.0, font: font_handle.clone(), }, }], ..default() }, style: Style { - margin: UiRect::all(Val::Px(20.0)), + margin: UiRect::all(Val::Px(10.0)), ..default() }, ..default() @@ -125,8 +130,8 @@ fn init_play_menu( ButtonAction(MenuState::Off), ButtonBundle { style: Style { - padding: UiRect::all(Val::Px(5.0)), - margin: UiRect::all(Val::Px(5.0)), + padding: UiRect::all(Val::Px(2.0)), + margin: UiRect::all(Val::Px(2.0)), ..default() }, image: UiImage { @@ -143,14 +148,14 @@ fn init_play_menu( value: "R e s t a r t".into(), style: TextStyle { color: Color::WHITE, - font_size: 16.0, + font_size: 12.0, font: font_handle.clone(), }, }], ..default() }, style: Style { - margin: UiRect::all(Val::Px(20.0)), + margin: UiRect::all(Val::Px(10.0)), ..default() }, ..default() @@ -164,8 +169,8 @@ fn init_play_menu( ButtonAction(MenuState::Off), ButtonBundle { style: Style { - padding: UiRect::all(Val::Px(5.0)), - margin: UiRect::all(Val::Px(5.0)), + padding: UiRect::all(Val::Px(2.0)), + margin: UiRect::all(Val::Px(2.0)), ..default() }, image: UiImage { @@ -182,14 +187,14 @@ fn init_play_menu( value: "T u t o r i a l".into(), style: TextStyle { color: Color::WHITE, - font_size: 16.0, + font_size: 12.0, font: font_handle.clone(), }, }], ..default() }, style: Style { - margin: UiRect::all(Val::Px(20.0)), + margin: UiRect::all(Val::Px(10.0)), ..default() }, ..default() @@ -203,8 +208,8 @@ fn init_play_menu( ButtonAction(MenuState::Off), ButtonBundle { style: Style { - padding: UiRect::all(Val::Px(5.0)), - margin: UiRect::all(Val::Px(5.0)), + padding: UiRect::all(Val::Px(2.0)), + margin: UiRect::all(Val::Px(2.0)), ..default() }, image: UiImage { @@ -221,14 +226,14 @@ fn init_play_menu( value: "C r e d i t s".into(), style: TextStyle { color: Color::WHITE, - font_size: 16.0, + font_size: 12.0, font: font_handle.clone(), }, }], ..default() }, style: Style { - margin: UiRect::all(Val::Px(20.0)), + margin: UiRect::all(Val::Px(10.0)), ..default() }, ..default() @@ -242,8 +247,8 @@ fn init_play_menu( ButtonAction(MenuState::Off), ButtonBundle { style: Style { - padding: UiRect::all(Val::Px(5.0)), - margin: UiRect::all(Val::Px(5.0)), + padding: UiRect::all(Val::Px(2.0)), + margin: UiRect::all(Val::Px(2.0)), ..default() }, image: UiImage { @@ -260,14 +265,14 @@ fn init_play_menu( value: "Q u i t".into(), style: TextStyle { color: Color::WHITE, - font_size: 16.0, + font_size: 12.0, font: font_handle.clone(), }, }], ..default() }, style: Style { - margin: UiRect::all(Val::Px(20.0)), + margin: UiRect::all(Val::Px(10.0)), ..default() }, ..default()