|
|
|
|
@ -18,11 +18,175 @@ fn main() {
|
|
|
|
|
))
|
|
|
|
|
// .init_resource::<Icon>()
|
|
|
|
|
.add_systems(Startup, init_ui2)
|
|
|
|
|
.add_systems(Update, toggle)
|
|
|
|
|
.add_systems(PostUpdate, selection)
|
|
|
|
|
// .add_systems(Startup, init_ui)
|
|
|
|
|
// .add_systems(Update, (cursors, container))
|
|
|
|
|
.run();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Bundle)]
|
|
|
|
|
struct UiKitContainer {
|
|
|
|
|
node_bundle: NodeBundle,
|
|
|
|
|
select: Select,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
|
enum UiKitPosition {
|
|
|
|
|
Top,
|
|
|
|
|
Left,
|
|
|
|
|
Right,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl UiKitContainer {
|
|
|
|
|
fn new(position: UiKitPosition) -> Self {
|
|
|
|
|
let style = match position {
|
|
|
|
|
UiKitPosition::Top => Style {
|
|
|
|
|
border: UiRect::all(Val::Px(1.0)),
|
|
|
|
|
top: Val::Percent(102.0),
|
|
|
|
|
left: Val::Px(-2.0),
|
|
|
|
|
flex_direction: FlexDirection::Column,
|
|
|
|
|
align_items: AlignItems::FlexStart,
|
|
|
|
|
display: Display::None,
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
UiKitPosition::Left => Style {
|
|
|
|
|
border: UiRect::all(Val::Px(1.0)),
|
|
|
|
|
left: Val::Percent(100.0),
|
|
|
|
|
top: Val::Px(-2.0),
|
|
|
|
|
flex_direction: FlexDirection::Column,
|
|
|
|
|
justify_items: JustifyItems::Start,
|
|
|
|
|
display: Display::None,
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
UiKitPosition::Right => Style {
|
|
|
|
|
border: UiRect::all(Val::Px(1.0)),
|
|
|
|
|
right: Val::Percent(104.0),
|
|
|
|
|
top: Val::Px(-2.0),
|
|
|
|
|
flex_direction: FlexDirection::Column,
|
|
|
|
|
justify_items: JustifyItems::Start,
|
|
|
|
|
display: Display::None,
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
UiKitContainer {
|
|
|
|
|
node_bundle: NodeBundle {
|
|
|
|
|
style,
|
|
|
|
|
background_color: BackgroundColor(Color::PURPLE),
|
|
|
|
|
border_color: BorderColor(Color::BLACK),
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
select: Select::None,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Bundle)]
|
|
|
|
|
struct UiKitButton {
|
|
|
|
|
button_bundle: ButtonBundle,
|
|
|
|
|
select: Select,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl UiKitButton {
|
|
|
|
|
fn new(color: Color) -> Self {
|
|
|
|
|
UiKitButton {
|
|
|
|
|
button_bundle: ButtonBundle {
|
|
|
|
|
style: Style {
|
|
|
|
|
border: UiRect::all(Val::Px(1.0)),
|
|
|
|
|
width: Val::Px(100.0),
|
|
|
|
|
height: Val::Px(50.0),
|
|
|
|
|
flex_direction: FlexDirection::Column,
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
background_color: BackgroundColor(color),
|
|
|
|
|
border_color: BorderColor(Color::BLACK),
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
select: Select::None,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Component, Copy, Clone)]
|
|
|
|
|
enum Select {
|
|
|
|
|
Active,
|
|
|
|
|
None,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// When an item is selected/de-selected change it's display accordingly
|
|
|
|
|
fn selection(
|
|
|
|
|
mut events: Query<(&mut BackgroundColor, &Select, &Children), (Changed<Select>, With<Button>)>,
|
|
|
|
|
mut styles: Query<&mut Style>,
|
|
|
|
|
) {
|
|
|
|
|
events
|
|
|
|
|
.iter_mut()
|
|
|
|
|
.for_each(|(mut bg_color, select, children)| {
|
|
|
|
|
bg_color.0 = match select {
|
|
|
|
|
Select::Active => Color::RED,
|
|
|
|
|
Select::None => Color::WHITE,
|
|
|
|
|
};
|
|
|
|
|
children.iter().for_each(|&child| {
|
|
|
|
|
if let Ok(mut style) = styles.get_mut(child) {
|
|
|
|
|
style.display = match select {
|
|
|
|
|
Select::Active => Display::Flex,
|
|
|
|
|
Select::None => Display::None,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Toggle a UI Nav tree open/closed
|
|
|
|
|
///
|
|
|
|
|
/// PERF: This is hella not performant, we just usually don't have many elements to iterate over so
|
|
|
|
|
/// it's tolerable.
|
|
|
|
|
///
|
|
|
|
|
// TODO: Should not be able to select multiple children in branch of tree
|
|
|
|
|
// TODO: Port to ui.rs
|
|
|
|
|
fn toggle(
|
|
|
|
|
events: Query<Entity, (Changed<Interaction>, With<Button>)>,
|
|
|
|
|
interactions: Query<&Interaction>,
|
|
|
|
|
mut selects: Query<&mut Select>,
|
|
|
|
|
children: Query<&Children>,
|
|
|
|
|
) {
|
|
|
|
|
events.iter().for_each(|entity| {
|
|
|
|
|
// If all interactions are inactive, set all selections to None
|
|
|
|
|
if interactions
|
|
|
|
|
.iter()
|
|
|
|
|
.all(|&interaction| interaction == Interaction::None)
|
|
|
|
|
{
|
|
|
|
|
selects.iter_mut().for_each(|mut select| {
|
|
|
|
|
*select = Select::None;
|
|
|
|
|
});
|
|
|
|
|
// Otherwise change this item's selection
|
|
|
|
|
} else {
|
|
|
|
|
let mut select = selects
|
|
|
|
|
.get_mut(entity)
|
|
|
|
|
.expect("Entity has Select component");
|
|
|
|
|
let interaction = interactions
|
|
|
|
|
.get(entity)
|
|
|
|
|
.expect("Entity has Interaction component");
|
|
|
|
|
*select = match interaction {
|
|
|
|
|
Interaction::Pressed | Interaction::Hovered => Select::Active,
|
|
|
|
|
Interaction::None => {
|
|
|
|
|
let children_inactive = children.iter_descendants(entity).all(|child| {
|
|
|
|
|
if let Ok(&c) = interactions.get(child) {
|
|
|
|
|
c == Interaction::None
|
|
|
|
|
} else {
|
|
|
|
|
true
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if children_inactive {
|
|
|
|
|
Select::None
|
|
|
|
|
} else {
|
|
|
|
|
Select::Active
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// const CURSORS: [CursorIcon; 35] = [
|
|
|
|
|
// CursorIcon::Default,
|
|
|
|
|
// CursorIcon::Crosshair,
|
|
|
|
|
@ -61,147 +225,134 @@ fn main() {
|
|
|
|
|
// CursorIcon::RowResize,
|
|
|
|
|
// ];
|
|
|
|
|
|
|
|
|
|
fn spawn_tree(parent: &mut ChildBuilder, pos: UiKitPosition, depth: u8, length: u8) {
|
|
|
|
|
fn spawn_tree(parent: &mut ChildBuilder, pos: UiKitPosition) {
|
|
|
|
|
let pos2 = match pos {
|
|
|
|
|
UiKitPosition::Top => UiKitPosition::Left,
|
|
|
|
|
_ => pos,
|
|
|
|
|
};
|
|
|
|
|
(0..length).for_each(|_| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
if depth > 1 {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitContainer::new(pos))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
spawn_tree(parent, pos2, depth - 1, length);
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitContainer::new(pos2))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitContainer::new(pos2))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitContainer::new(pos2))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitContainer::new(pos))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitContainer::new(pos2))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitContainer::new(pos2))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitContainer::new(pos2))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitContainer::new(pos))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitContainer::new(pos2))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitContainer::new(pos2))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(UiKitContainer::new(pos2))
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitContainer::new(pos))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitContainer::new(pos2))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitContainer::new(pos2))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitContainer::new(pos2))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitContainer::new(pos))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitContainer::new(pos2))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitContainer::new(pos2))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitContainer::new(pos2))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitContainer::new(pos))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitContainer::new(pos2))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitContainer::new(pos2))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitButton::new(Color::PINK))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent
|
|
|
|
|
// .spawn(UiKitContainer::new(pos2))
|
|
|
|
|
// .with_children(|parent| {
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// parent.spawn(UiKitButton::new(Color::PINK));
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn init_ui2(mut commands: Commands) {
|
|
|
|
|
@ -222,23 +373,6 @@ fn init_ui2(mut commands: Commands) {
|
|
|
|
|
..default()
|
|
|
|
|
})
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent
|
|
|
|
|
.spawn(ButtonBundle {
|
|
|
|
|
style: Style {
|
|
|
|
|
border: UiRect::all(Val::Px(1.0)),
|
|
|
|
|
width: Val::Px(200.0),
|
|
|
|
|
height: Val::Px(150.0),
|
|
|
|
|
align_self: AlignSelf::Center,
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
background_color: BackgroundColor(Color::WHITE),
|
|
|
|
|
border_color: BorderColor(Color::BLACK),
|
|
|
|
|
..default()
|
|
|
|
|
})
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
parent.spawn(UiKitTextInput::new());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
parent
|
|
|
|
|
.spawn(NodeBundle {
|
|
|
|
|
style: Style {
|
|
|
|
|
@ -254,7 +388,7 @@ fn init_ui2(mut commands: Commands) {
|
|
|
|
|
..default()
|
|
|
|
|
})
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
spawn_tree(parent, UiKitPosition::Left, 3, 7);
|
|
|
|
|
spawn_tree(parent, UiKitPosition::Left);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
parent
|
|
|
|
|
@ -272,7 +406,7 @@ fn init_ui2(mut commands: Commands) {
|
|
|
|
|
..default()
|
|
|
|
|
})
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
spawn_tree(parent, UiKitPosition::Right, 3, 7);
|
|
|
|
|
spawn_tree(parent, UiKitPosition::Right);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
parent
|
|
|
|
|
@ -289,7 +423,7 @@ fn init_ui2(mut commands: Commands) {
|
|
|
|
|
..default()
|
|
|
|
|
})
|
|
|
|
|
.with_children(|parent| {
|
|
|
|
|
spawn_tree(parent, UiKitPosition::Top, 3, 7);
|
|
|
|
|
spawn_tree(parent, UiKitPosition::Top);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|