use bevy::{ input::{keyboard::KeyboardInput, ButtonState}, prelude::*, window::PrimaryWindow, }; use monologue_trees::{debug::*, ui::*}; fn main() { App::new() .add_plugins(( DefaultPlugins.set(WindowPlugin { primary_window: Some(Window { title: "UI WTF".into(), resolution: (640., 480.).into(), ..default() }), ..default() }), GameUiPlugin, )) // .init_resource::() .add_systems(Startup, init_ui2) .add_systems(Update, toggle) // .add_systems(Startup, init_ui) // .add_systems(Update, (cursors, container())) .run(); } fn container() -> NodeBundle { NodeBundle { style: Style { border: UiRect::all(Val::Px(2.0)), right: Val::Percent(-100.0), top: Val::Px(-4.0), flex_direction: FlexDirection::Column, display: Display::None, ..default() }, background_color: BackgroundColor(Color::PURPLE), border_color: BorderColor(Color::BLACK), ..default() } } fn spec(color: Color) -> ButtonBundle { ButtonBundle { style: Style { border: UiRect::all(Val::Px(2.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() } } fn toggle( mut events: Query< (&mut BackgroundColor, &Interaction, &Children), (Changed, With