saving my place

main
Elijah Voigt 2 years ago
parent a2a4b11087
commit f47d32b54d

@ -103,7 +103,13 @@ fn initialize_ui(mut commands: Commands) {
.spawn(( .spawn((
GameUiList, GameUiList,
Name::new("GLTFs"), Name::new("GLTFs"),
NodeBundle { ..default() }, NodeBundle {
style: Style {
flex_direction: FlexDirection::Row,
..default()
},
..default()
},
GltfsUi, GltfsUi,
UiCollapse::Show, UiCollapse::Show,
)) ))
@ -133,7 +139,13 @@ fn initialize_ui(mut commands: Commands) {
parent.spawn(( parent.spawn((
GameUiSet, GameUiSet,
Name::new("Audio Clips"), Name::new("Audio Clips"),
NodeBundle { ..default() }, NodeBundle {
style: Style {
flex_direction: FlexDirection::Column,
..default()
},
..default()
},
AudioClipsUi, AudioClipsUi,
UiCollapse::Show, UiCollapse::Show,
)); ));

@ -197,16 +197,21 @@ fn container(
match (key_code, state) { match (key_code, state) {
(Some(KeyCode::Up), ButtonState::Pressed) => { (Some(KeyCode::Up), ButtonState::Pressed) => {
commands.entity(root.single()).with_children(|parent| { commands.entity(root.single()).with_children(|parent| {
parent.spawn(NodeBundle { parent
.spawn(ButtonBundle {
style: Style { style: Style {
width: Val::Px(10.0),
height: Val::Px(10.0),
padding: UiRect::all(Val::Px(10.0)), padding: UiRect::all(Val::Px(10.0)),
margin: UiRect::all(Val::Px(10.0)), margin: UiRect::all(Val::Px(10.0)),
..default() ..default()
}, },
background_color: BackgroundColor(Color::PURPLE), background_color: BackgroundColor(Color::PURPLE),
..default() ..default()
})
.with_children(|parent| {
parent.spawn(TextBundle::from_section(
"asdfwtf",
TextStyle { ..default() },
));
}); });
}); });
} }

@ -141,17 +141,11 @@ fn init_ui_list(events: Query<(Entity, &Name), Added<GameUiList>>, mut commands:
.entity(entity) .entity(entity)
.insert(NodeBundle { .insert(NodeBundle {
style: Style { style: Style {
// align_content: AlignContent::FlexStart,
align_items: AlignItems::Stretch,
border: UiRect::all(Val::Px(2.0)),
flex_direction: FlexDirection::Column, flex_direction: FlexDirection::Column,
justify_items: JustifyItems::Center, justify_items: JustifyItems::Center,
border: UiRect::all(Val::Px(2.0)),
margin: UiRect::all(Val::Px(2.0)), margin: UiRect::all(Val::Px(2.0)),
padding: UiRect::all(Val::Px(2.0)), padding: UiRect::all(Val::Px(2.0)),
// overflow: Overflow {
// x: OverflowAxis::Clip,
// y: OverflowAxis::Clip,
// },
..default() ..default()
}, },
background_color: BackgroundColor(Color::RED), background_color: BackgroundColor(Color::RED),
@ -181,17 +175,11 @@ fn init_ui_set(events: Query<(Entity, &Name), Added<GameUiSet>>, mut commands: C
.entity(entity) .entity(entity)
.insert(NodeBundle { .insert(NodeBundle {
style: Style { style: Style {
// align_content: AlignContent::FlexStart,
align_items: AlignItems::FlexStart,
border: UiRect::all(Val::Px(2.0)),
flex_direction: FlexDirection::Row, flex_direction: FlexDirection::Row,
flex_wrap: FlexWrap::Wrap, flex_wrap: FlexWrap::Wrap,
border: UiRect::all(Val::Px(2.0)),
margin: UiRect::all(Val::Px(2.0)), margin: UiRect::all(Val::Px(2.0)),
padding: UiRect::all(Val::Px(2.0)), padding: UiRect::all(Val::Px(2.0)),
// overflow: Overflow {
// x: OverflowAxis::Clip,
// y: OverflowAxis::Clip,
// },
..default() ..default()
}, },
background_color: BackgroundColor(Color::BLUE), background_color: BackgroundColor(Color::BLUE),
@ -225,7 +213,6 @@ fn init_ui_button(events: Query<(Entity, &Name), Added<GameUiButton>>, mut comma
margin: UiRect::all(Val::Px(2.0)), margin: UiRect::all(Val::Px(2.0)),
padding: UiRect::all(Val::Px(2.0)), padding: UiRect::all(Val::Px(2.0)),
border: UiRect::all(Val::Px(2.0)), border: UiRect::all(Val::Px(2.0)),
justify_content: JustifyContent::Center,
..default() ..default()
}, },
background_color: BackgroundColor(Color::GREEN), background_color: BackgroundColor(Color::GREEN),

Loading…
Cancel
Save