Rename UiColor to BackgroundColor (#6087)
# Objective Fixes #6078. The `UiColor` component is unhelpfully named: it is unclear, ambiguous with border color and ## Solution Rename the `UiColor` component (and associated fields) to `BackgroundColor` / `background_colorl`. ## Migration Guide `UiColor` has been renamed to `BackgroundColor`. This change affects `NodeBundle`, `ButtonBundle` and `ImageBundle`. In addition, the corresponding field on `ExtractedUiNode` has been renamed to `background_color` for consistency.
This commit is contained in:
parent
e7cd9c1b86
commit
481eec2c92
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
widget::{Button, ImageMode},
|
widget::{Button, ImageMode},
|
||||||
CalculatedSize, FocusPolicy, Interaction, Node, Style, UiColor, UiImage,
|
BackgroundColor, CalculatedSize, FocusPolicy, Interaction, Node, Style, UiImage,
|
||||||
};
|
};
|
||||||
use bevy_ecs::{
|
use bevy_ecs::{
|
||||||
bundle::Bundle,
|
bundle::Bundle,
|
||||||
@ -23,8 +23,8 @@ pub struct NodeBundle {
|
|||||||
pub node: Node,
|
pub node: Node,
|
||||||
/// Describes the style including flexbox settings
|
/// Describes the style including flexbox settings
|
||||||
pub style: Style,
|
pub style: Style,
|
||||||
/// Describes the color of the node
|
/// The background color, which serves as a "fill" for this node
|
||||||
pub color: UiColor,
|
pub background_color: BackgroundColor,
|
||||||
/// Describes the image of the node
|
/// Describes the image of the node
|
||||||
pub image: UiImage,
|
pub image: UiImage,
|
||||||
/// Whether this node should block interaction with lower nodes
|
/// Whether this node should block interaction with lower nodes
|
||||||
@ -50,8 +50,10 @@ pub struct ImageBundle {
|
|||||||
pub image_mode: ImageMode,
|
pub image_mode: ImageMode,
|
||||||
/// The calculated size based on the given image
|
/// The calculated size based on the given image
|
||||||
pub calculated_size: CalculatedSize,
|
pub calculated_size: CalculatedSize,
|
||||||
/// The color of the node
|
/// The background color, which serves as a "fill" for this node
|
||||||
pub color: UiColor,
|
///
|
||||||
|
/// When combined with `UiImage`, tints the provided image.
|
||||||
|
pub background_color: BackgroundColor,
|
||||||
/// The image of the node
|
/// The image of the node
|
||||||
pub image: UiImage,
|
pub image: UiImage,
|
||||||
/// Whether this node should block interaction with lower nodes
|
/// Whether this node should block interaction with lower nodes
|
||||||
@ -152,8 +154,10 @@ pub struct ButtonBundle {
|
|||||||
pub interaction: Interaction,
|
pub interaction: Interaction,
|
||||||
/// Whether this node should block interaction with lower nodes
|
/// Whether this node should block interaction with lower nodes
|
||||||
pub focus_policy: FocusPolicy,
|
pub focus_policy: FocusPolicy,
|
||||||
/// The color of the node
|
/// The background color, which serves as a "fill" for this node
|
||||||
pub color: UiColor,
|
///
|
||||||
|
/// When combined with `UiImage`, tints the provided image.
|
||||||
|
pub background_color: BackgroundColor,
|
||||||
/// The image of the node
|
/// The image of the node
|
||||||
pub image: UiImage,
|
pub image: UiImage,
|
||||||
/// The transform of the node
|
/// The transform of the node
|
||||||
@ -174,7 +178,7 @@ impl Default for ButtonBundle {
|
|||||||
focus_policy: Default::default(),
|
focus_policy: Default::default(),
|
||||||
node: Default::default(),
|
node: Default::default(),
|
||||||
style: Default::default(),
|
style: Default::default(),
|
||||||
color: Default::default(),
|
background_color: Default::default(),
|
||||||
image: Default::default(),
|
image: Default::default(),
|
||||||
transform: Default::default(),
|
transform: Default::default(),
|
||||||
global_transform: Default::default(),
|
global_transform: Default::default(),
|
||||||
|
|||||||
@ -90,7 +90,7 @@ impl Plugin for UiPlugin {
|
|||||||
.register_type::<Size>()
|
.register_type::<Size>()
|
||||||
.register_type::<UiRect>()
|
.register_type::<UiRect>()
|
||||||
.register_type::<Style>()
|
.register_type::<Style>()
|
||||||
.register_type::<UiColor>()
|
.register_type::<BackgroundColor>()
|
||||||
.register_type::<UiImage>()
|
.register_type::<UiImage>()
|
||||||
.register_type::<Val>()
|
.register_type::<Val>()
|
||||||
.register_type::<widget::Button>()
|
.register_type::<widget::Button>()
|
||||||
|
|||||||
@ -5,7 +5,7 @@ use bevy_core_pipeline::{core_2d::Camera2d, core_3d::Camera3d};
|
|||||||
pub use pipeline::*;
|
pub use pipeline::*;
|
||||||
pub use render_pass::*;
|
pub use render_pass::*;
|
||||||
|
|
||||||
use crate::{prelude::UiCameraConfig, CalculatedClip, Node, UiColor, UiImage};
|
use crate::{prelude::UiCameraConfig, BackgroundColor, CalculatedClip, Node, UiImage};
|
||||||
use bevy_app::prelude::*;
|
use bevy_app::prelude::*;
|
||||||
use bevy_asset::{load_internal_asset, AssetEvent, Assets, Handle, HandleUntyped};
|
use bevy_asset::{load_internal_asset, AssetEvent, Assets, Handle, HandleUntyped};
|
||||||
use bevy_ecs::prelude::*;
|
use bevy_ecs::prelude::*;
|
||||||
@ -161,7 +161,7 @@ fn get_ui_graph(render_app: &mut App) -> RenderGraph {
|
|||||||
|
|
||||||
pub struct ExtractedUiNode {
|
pub struct ExtractedUiNode {
|
||||||
pub transform: Mat4,
|
pub transform: Mat4,
|
||||||
pub color: Color,
|
pub background_color: Color,
|
||||||
pub rect: Rect,
|
pub rect: Rect,
|
||||||
pub image: Handle<Image>,
|
pub image: Handle<Image>,
|
||||||
pub atlas_size: Option<Vec2>,
|
pub atlas_size: Option<Vec2>,
|
||||||
@ -180,7 +180,7 @@ pub fn extract_uinodes(
|
|||||||
Query<(
|
Query<(
|
||||||
&Node,
|
&Node,
|
||||||
&GlobalTransform,
|
&GlobalTransform,
|
||||||
&UiColor,
|
&BackgroundColor,
|
||||||
&UiImage,
|
&UiImage,
|
||||||
&ComputedVisibility,
|
&ComputedVisibility,
|
||||||
Option<&CalculatedClip>,
|
Option<&CalculatedClip>,
|
||||||
@ -203,7 +203,7 @@ pub fn extract_uinodes(
|
|||||||
}
|
}
|
||||||
extracted_uinodes.uinodes.push(ExtractedUiNode {
|
extracted_uinodes.uinodes.push(ExtractedUiNode {
|
||||||
transform: transform.compute_matrix(),
|
transform: transform.compute_matrix(),
|
||||||
color: color.0,
|
background_color: color.0,
|
||||||
rect: Rect {
|
rect: Rect {
|
||||||
min: Vec2::ZERO,
|
min: Vec2::ZERO,
|
||||||
max: uinode.size,
|
max: uinode.size,
|
||||||
@ -328,7 +328,7 @@ pub fn extract_text_uinodes(
|
|||||||
|
|
||||||
extracted_uinodes.uinodes.push(ExtractedUiNode {
|
extracted_uinodes.uinodes.push(ExtractedUiNode {
|
||||||
transform: extracted_transform,
|
transform: extracted_transform,
|
||||||
color,
|
background_color: color,
|
||||||
rect,
|
rect,
|
||||||
image: texture,
|
image: texture,
|
||||||
atlas_size,
|
atlas_size,
|
||||||
@ -490,7 +490,7 @@ pub fn prepare_uinodes(
|
|||||||
ui_meta.vertices.push(UiVertex {
|
ui_meta.vertices.push(UiVertex {
|
||||||
position: positions_clipped[i].into(),
|
position: positions_clipped[i].into(),
|
||||||
uv: uvs[i].into(),
|
uv: uvs[i].into(),
|
||||||
color: extracted_uinode.color.as_linear_rgba_f32(),
|
color: extracted_uinode.background_color.as_linear_rgba_f32(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -375,18 +375,21 @@ pub struct CalculatedSize {
|
|||||||
pub size: Size,
|
pub size: Size,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The color of the node
|
/// The background color of the node
|
||||||
|
///
|
||||||
|
/// This serves as the "fill" color.
|
||||||
|
/// When combined with [`UiImage`], tints the provided texture.
|
||||||
#[derive(Component, Default, Copy, Clone, Debug, Reflect)]
|
#[derive(Component, Default, Copy, Clone, Debug, Reflect)]
|
||||||
#[reflect(Component, Default)]
|
#[reflect(Component, Default)]
|
||||||
pub struct UiColor(pub Color);
|
pub struct BackgroundColor(pub Color);
|
||||||
|
|
||||||
impl From<Color> for UiColor {
|
impl From<Color> for BackgroundColor {
|
||||||
fn from(color: Color) -> Self {
|
fn from(color: Color) -> Self {
|
||||||
Self(color)
|
Self(color)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The image of the node
|
/// The 2D texture displayed for this UI node
|
||||||
#[derive(Component, Clone, Debug, Reflect, Deref, DerefMut)]
|
#[derive(Component, Clone, Debug, Reflect, Deref, DerefMut)]
|
||||||
#[reflect(Component, Default)]
|
#[reflect(Component, Default)]
|
||||||
pub struct UiImage(pub Handle<Image>);
|
pub struct UiImage(pub Handle<Image>);
|
||||||
|
|||||||
@ -52,7 +52,7 @@ fn setup_menu(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
align_items: AlignItems::Center,
|
align_items: AlignItems::Center,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: NORMAL_BUTTON.into(),
|
background_color: NORMAL_BUTTON.into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
@ -72,7 +72,7 @@ fn setup_menu(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
fn menu(
|
fn menu(
|
||||||
mut state: ResMut<State<AppState>>,
|
mut state: ResMut<State<AppState>>,
|
||||||
mut interaction_query: Query<
|
mut interaction_query: Query<
|
||||||
(&Interaction, &mut UiColor),
|
(&Interaction, &mut BackgroundColor),
|
||||||
(Changed<Interaction>, With<Button>),
|
(Changed<Interaction>, With<Button>),
|
||||||
>,
|
>,
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -379,7 +379,7 @@ fn display_score(mut commands: Commands, asset_server: Res<AssetServer>, game: R
|
|||||||
align_items: AlignItems::Center,
|
align_items: AlignItems::Center,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::NONE.into(),
|
background_color: Color::NONE.into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
|
|||||||
@ -161,7 +161,7 @@ mod game {
|
|||||||
align_items: AlignItems::Center,
|
align_items: AlignItems::Center,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::BLACK.into(),
|
background_color: Color::BLACK.into(),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
OnGameScreen,
|
OnGameScreen,
|
||||||
@ -349,7 +349,7 @@ mod menu {
|
|||||||
// This system handles changing all buttons color based on mouse interaction
|
// This system handles changing all buttons color based on mouse interaction
|
||||||
fn button_system(
|
fn button_system(
|
||||||
mut interaction_query: Query<
|
mut interaction_query: Query<
|
||||||
(&Interaction, &mut UiColor, Option<&SelectedOption>),
|
(&Interaction, &mut BackgroundColor, Option<&SelectedOption>),
|
||||||
(Changed<Interaction>, With<Button>),
|
(Changed<Interaction>, With<Button>),
|
||||||
>,
|
>,
|
||||||
) {
|
) {
|
||||||
@ -367,7 +367,7 @@ mod menu {
|
|||||||
// the button as the one currently selected
|
// the button as the one currently selected
|
||||||
fn setting_button<T: Resource + Component + PartialEq + Copy>(
|
fn setting_button<T: Resource + Component + PartialEq + Copy>(
|
||||||
interaction_query: Query<(&Interaction, &T, Entity), (Changed<Interaction>, With<Button>)>,
|
interaction_query: Query<(&Interaction, &T, Entity), (Changed<Interaction>, With<Button>)>,
|
||||||
mut selected_query: Query<(Entity, &mut UiColor), With<SelectedOption>>,
|
mut selected_query: Query<(Entity, &mut BackgroundColor), With<SelectedOption>>,
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
mut setting: ResMut<T>,
|
mut setting: ResMut<T>,
|
||||||
) {
|
) {
|
||||||
@ -424,7 +424,7 @@ mod menu {
|
|||||||
align_items: AlignItems::Center,
|
align_items: AlignItems::Center,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::CRIMSON.into(),
|
background_color: Color::CRIMSON.into(),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
OnMainMenuScreen,
|
OnMainMenuScreen,
|
||||||
@ -454,7 +454,7 @@ mod menu {
|
|||||||
.spawn((
|
.spawn((
|
||||||
ButtonBundle {
|
ButtonBundle {
|
||||||
style: button_style.clone(),
|
style: button_style.clone(),
|
||||||
color: NORMAL_BUTTON.into(),
|
background_color: NORMAL_BUTTON.into(),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
MenuButtonAction::Play,
|
MenuButtonAction::Play,
|
||||||
@ -475,7 +475,7 @@ mod menu {
|
|||||||
.spawn((
|
.spawn((
|
||||||
ButtonBundle {
|
ButtonBundle {
|
||||||
style: button_style.clone(),
|
style: button_style.clone(),
|
||||||
color: NORMAL_BUTTON.into(),
|
background_color: NORMAL_BUTTON.into(),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
MenuButtonAction::Settings,
|
MenuButtonAction::Settings,
|
||||||
@ -496,7 +496,7 @@ mod menu {
|
|||||||
.spawn((
|
.spawn((
|
||||||
ButtonBundle {
|
ButtonBundle {
|
||||||
style: button_style,
|
style: button_style,
|
||||||
color: NORMAL_BUTTON.into(),
|
background_color: NORMAL_BUTTON.into(),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
MenuButtonAction::Quit,
|
MenuButtonAction::Quit,
|
||||||
@ -537,7 +537,7 @@ mod menu {
|
|||||||
align_items: AlignItems::Center,
|
align_items: AlignItems::Center,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::CRIMSON.into(),
|
background_color: Color::CRIMSON.into(),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
OnSettingsMenuScreen,
|
OnSettingsMenuScreen,
|
||||||
@ -552,7 +552,7 @@ mod menu {
|
|||||||
.spawn((
|
.spawn((
|
||||||
ButtonBundle {
|
ButtonBundle {
|
||||||
style: button_style.clone(),
|
style: button_style.clone(),
|
||||||
color: NORMAL_BUTTON.into(),
|
background_color: NORMAL_BUTTON.into(),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
action,
|
action,
|
||||||
@ -591,7 +591,7 @@ mod menu {
|
|||||||
align_items: AlignItems::Center,
|
align_items: AlignItems::Center,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::CRIMSON.into(),
|
background_color: Color::CRIMSON.into(),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
OnDisplaySettingsMenuScreen,
|
OnDisplaySettingsMenuScreen,
|
||||||
@ -605,7 +605,7 @@ mod menu {
|
|||||||
align_items: AlignItems::Center,
|
align_items: AlignItems::Center,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::CRIMSON.into(),
|
background_color: Color::CRIMSON.into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
@ -625,7 +625,7 @@ mod menu {
|
|||||||
size: Size::new(Val::Px(150.0), Val::Px(65.0)),
|
size: Size::new(Val::Px(150.0), Val::Px(65.0)),
|
||||||
..button_style.clone()
|
..button_style.clone()
|
||||||
},
|
},
|
||||||
color: NORMAL_BUTTON.into(),
|
background_color: NORMAL_BUTTON.into(),
|
||||||
..default()
|
..default()
|
||||||
});
|
});
|
||||||
entity.insert(quality_setting).with_children(|parent| {
|
entity.insert(quality_setting).with_children(|parent| {
|
||||||
@ -644,7 +644,7 @@ mod menu {
|
|||||||
.spawn((
|
.spawn((
|
||||||
ButtonBundle {
|
ButtonBundle {
|
||||||
style: button_style,
|
style: button_style,
|
||||||
color: NORMAL_BUTTON.into(),
|
background_color: NORMAL_BUTTON.into(),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
MenuButtonAction::BackToSettings,
|
MenuButtonAction::BackToSettings,
|
||||||
@ -682,7 +682,7 @@ mod menu {
|
|||||||
align_items: AlignItems::Center,
|
align_items: AlignItems::Center,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::CRIMSON.into(),
|
background_color: Color::CRIMSON.into(),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
OnSoundSettingsMenuScreen,
|
OnSoundSettingsMenuScreen,
|
||||||
@ -694,7 +694,7 @@ mod menu {
|
|||||||
align_items: AlignItems::Center,
|
align_items: AlignItems::Center,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::CRIMSON.into(),
|
background_color: Color::CRIMSON.into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
@ -708,7 +708,7 @@ mod menu {
|
|||||||
size: Size::new(Val::Px(30.0), Val::Px(65.0)),
|
size: Size::new(Val::Px(30.0), Val::Px(65.0)),
|
||||||
..button_style.clone()
|
..button_style.clone()
|
||||||
},
|
},
|
||||||
color: NORMAL_BUTTON.into(),
|
background_color: NORMAL_BUTTON.into(),
|
||||||
..default()
|
..default()
|
||||||
});
|
});
|
||||||
entity.insert(Volume(volume_setting));
|
entity.insert(Volume(volume_setting));
|
||||||
@ -721,7 +721,7 @@ mod menu {
|
|||||||
.spawn((
|
.spawn((
|
||||||
ButtonBundle {
|
ButtonBundle {
|
||||||
style: button_style,
|
style: button_style,
|
||||||
color: NORMAL_BUTTON.into(),
|
background_color: NORMAL_BUTTON.into(),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
MenuButtonAction::BackToSettings,
|
MenuButtonAction::BackToSettings,
|
||||||
|
|||||||
@ -124,7 +124,7 @@ fn setup_scene(
|
|||||||
|
|
||||||
fn button_handler(
|
fn button_handler(
|
||||||
mut interaction_query: Query<
|
mut interaction_query: Query<
|
||||||
(&Interaction, &mut UiColor),
|
(&Interaction, &mut BackgroundColor),
|
||||||
(Changed<Interaction>, With<Button>),
|
(Changed<Interaction>, With<Button>),
|
||||||
>,
|
>,
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -25,10 +25,13 @@ fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
struct IdleColor(UiColor);
|
struct IdleColor(BackgroundColor);
|
||||||
|
|
||||||
fn button_system(
|
fn button_system(
|
||||||
mut interaction_query: Query<(&Interaction, &mut UiColor, &IdleColor), Changed<Interaction>>,
|
mut interaction_query: Query<
|
||||||
|
(&Interaction, &mut BackgroundColor, &IdleColor),
|
||||||
|
Changed<Interaction>,
|
||||||
|
>,
|
||||||
) {
|
) {
|
||||||
for (interaction, mut material, IdleColor(idle_color)) in interaction_query.iter_mut() {
|
for (interaction, mut material, IdleColor(idle_color)) in interaction_query.iter_mut() {
|
||||||
if matches!(interaction, Interaction::Hovered) {
|
if matches!(interaction, Interaction::Hovered) {
|
||||||
@ -74,7 +77,7 @@ fn setup(mut commands: Commands, font: Res<UiFont>) {
|
|||||||
fn spawn_button(
|
fn spawn_button(
|
||||||
commands: &mut ChildBuilder,
|
commands: &mut ChildBuilder,
|
||||||
font: Handle<Font>,
|
font: Handle<Font>,
|
||||||
color: UiColor,
|
color: BackgroundColor,
|
||||||
total: f32,
|
total: f32,
|
||||||
i: usize,
|
i: usize,
|
||||||
j: usize,
|
j: usize,
|
||||||
@ -95,7 +98,7 @@ fn spawn_button(
|
|||||||
position_type: PositionType::Absolute,
|
position_type: PositionType::Absolute,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color,
|
background_color: color,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
IdleColor(color),
|
IdleColor(color),
|
||||||
|
|||||||
@ -19,7 +19,7 @@ const PRESSED_BUTTON: Color = Color::rgb(0.35, 0.75, 0.35);
|
|||||||
|
|
||||||
fn button_system(
|
fn button_system(
|
||||||
mut interaction_query: Query<
|
mut interaction_query: Query<
|
||||||
(&Interaction, &mut UiColor, &Children),
|
(&Interaction, &mut BackgroundColor, &Children),
|
||||||
(Changed<Interaction>, With<Button>),
|
(Changed<Interaction>, With<Button>),
|
||||||
>,
|
>,
|
||||||
mut text_query: Query<&mut Text>,
|
mut text_query: Query<&mut Text>,
|
||||||
@ -58,7 +58,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
align_items: AlignItems::Center,
|
align_items: AlignItems::Center,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: NORMAL_BUTTON.into(),
|
background_color: NORMAL_BUTTON.into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
|
|||||||
@ -44,7 +44,7 @@ fn setup(mut commands: Commands, asset_server: ResMut<AssetServer>) {
|
|||||||
align_items: AlignItems::Center,
|
align_items: AlignItems::Center,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::ANTIQUE_WHITE.into(),
|
background_color: Color::ANTIQUE_WHITE.into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
@ -54,7 +54,7 @@ fn setup(mut commands: Commands, asset_server: ResMut<AssetServer>) {
|
|||||||
size: Size::new(Val::Px(40.), Val::Px(40.)),
|
size: Size::new(Val::Px(40.), Val::Px(40.)),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::RED.into(),
|
background_color: Color::RED.into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
@ -65,7 +65,7 @@ fn setup(mut commands: Commands, asset_server: ResMut<AssetServer>) {
|
|||||||
size: Size::new(Val::Percent(15.), Val::Percent(15.)),
|
size: Size::new(Val::Percent(15.), Val::Percent(15.)),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::BLUE.into(),
|
background_color: Color::BLUE.into(),
|
||||||
..default()
|
..default()
|
||||||
});
|
});
|
||||||
parent.spawn(ImageBundle {
|
parent.spawn(ImageBundle {
|
||||||
|
|||||||
@ -25,7 +25,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
align_items: AlignItems::Center,
|
align_items: AlignItems::Center,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::rgb(0.1, 0.5, 0.1).into(),
|
background_color: Color::rgb(0.1, 0.5, 0.1).into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
@ -51,7 +51,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
align_items: AlignItems::Center,
|
align_items: AlignItems::Center,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::rgb(0.5, 0.1, 0.5).into(),
|
background_color: Color::rgb(0.5, 0.1, 0.5).into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
|
|||||||
@ -28,7 +28,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
justify_content: JustifyContent::SpaceBetween,
|
justify_content: JustifyContent::SpaceBetween,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::NONE.into(),
|
background_color: Color::NONE.into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
@ -40,7 +40,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
border: UiRect::all(Val::Px(2.0)),
|
border: UiRect::all(Val::Px(2.0)),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::rgb(0.65, 0.65, 0.65).into(),
|
background_color: Color::rgb(0.65, 0.65, 0.65).into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
@ -52,7 +52,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
align_items: AlignItems::FlexEnd,
|
align_items: AlignItems::FlexEnd,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::rgb(0.15, 0.15, 0.15).into(),
|
background_color: Color::rgb(0.15, 0.15, 0.15).into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
@ -82,7 +82,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
size: Size::new(Val::Px(200.0), Val::Percent(100.0)),
|
size: Size::new(Val::Px(200.0), Val::Percent(100.0)),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::rgb(0.15, 0.15, 0.15).into(),
|
background_color: Color::rgb(0.15, 0.15, 0.15).into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
@ -116,7 +116,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
overflow: Overflow::Hidden,
|
overflow: Overflow::Hidden,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::rgb(0.10, 0.10, 0.10).into(),
|
background_color: Color::rgb(0.10, 0.10, 0.10).into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
@ -130,7 +130,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
max_size: Size::UNDEFINED,
|
max_size: Size::UNDEFINED,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::NONE.into(),
|
background_color: Color::NONE.into(),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
ScrollingList::default(),
|
ScrollingList::default(),
|
||||||
@ -177,7 +177,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
border: UiRect::all(Val::Px(20.0)),
|
border: UiRect::all(Val::Px(20.0)),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::rgb(0.4, 0.4, 1.0).into(),
|
background_color: Color::rgb(0.4, 0.4, 1.0).into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
@ -186,7 +186,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
size: Size::new(Val::Percent(100.0), Val::Percent(100.0)),
|
size: Size::new(Val::Percent(100.0), Val::Percent(100.0)),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::rgb(0.8, 0.8, 1.0).into(),
|
background_color: Color::rgb(0.8, 0.8, 1.0).into(),
|
||||||
..default()
|
..default()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -200,7 +200,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
justify_content: JustifyContent::Center,
|
justify_content: JustifyContent::Center,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::NONE.into(),
|
background_color: Color::NONE.into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
@ -210,7 +210,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
size: Size::new(Val::Px(100.0), Val::Px(100.0)),
|
size: Size::new(Val::Px(100.0), Val::Px(100.0)),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::rgb(1.0, 0.0, 0.0).into(),
|
background_color: Color::rgb(1.0, 0.0, 0.0).into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
@ -225,7 +225,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
},
|
},
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::rgb(1.0, 0.3, 0.3).into(),
|
background_color: Color::rgb(1.0, 0.3, 0.3).into(),
|
||||||
..default()
|
..default()
|
||||||
});
|
});
|
||||||
parent.spawn(NodeBundle {
|
parent.spawn(NodeBundle {
|
||||||
@ -239,7 +239,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
},
|
},
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::rgb(1.0, 0.5, 0.5).into(),
|
background_color: Color::rgb(1.0, 0.5, 0.5).into(),
|
||||||
..default()
|
..default()
|
||||||
});
|
});
|
||||||
parent.spawn(NodeBundle {
|
parent.spawn(NodeBundle {
|
||||||
@ -253,7 +253,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
},
|
},
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::rgb(1.0, 0.7, 0.7).into(),
|
background_color: Color::rgb(1.0, 0.7, 0.7).into(),
|
||||||
..default()
|
..default()
|
||||||
});
|
});
|
||||||
// alpha test
|
// alpha test
|
||||||
@ -268,7 +268,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
},
|
},
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::rgba(1.0, 0.9, 0.9, 0.4).into(),
|
background_color: Color::rgba(1.0, 0.9, 0.9, 0.4).into(),
|
||||||
..default()
|
..default()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -283,7 +283,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
align_items: AlignItems::FlexEnd,
|
align_items: AlignItems::FlexEnd,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::NONE.into(),
|
background_color: Color::NONE.into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
|
|||||||
@ -28,7 +28,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
justify_content: JustifyContent::SpaceBetween,
|
justify_content: JustifyContent::SpaceBetween,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::NONE.into(),
|
background_color: Color::NONE.into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
@ -40,7 +40,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
border: UiRect::all(Val::Px(2.0)),
|
border: UiRect::all(Val::Px(2.0)),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
color: Color::rgb(0.65, 0.65, 0.65).into(),
|
background_color: Color::rgb(0.65, 0.65, 0.65).into(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.with_children(|parent| {
|
.with_children(|parent| {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user