DEVELOPMENT ENVIRONMENT

~liljamo/bevy_dice

7aa3a9f848d3393997c92d29f209f6f00a3e19de — Jonni Liljamo a day ago 9b789f8 master
fix(demo): ui clipping
1 files changed, 12 insertions(+), 17 deletions(-)

M crates/bevy_dice_demo/src/ui.rs
M crates/bevy_dice_demo/src/ui.rs => crates/bevy_dice_demo/src/ui.rs +12 -17
@@ 229,8 229,14 @@ fn set_selected_variant_text(
}

fn setup(mut commands: Commands) {
    let buttons = commands
        .spawn((
    commands.spawn((
        Node {
            width: Val::Percent(100.0),
            height: Val::Percent(100.0),
            padding: UiRect::all(Val::Px(8.0)),
            ..Default::default()
        },
        children![(
            Node {
                width: Val::Percent(100.0),
                flex_direction: FlexDirection::Row,


@@ 243,14 249,16 @@ fn setup(mut commands: Commands) {
                button(ButtonFunction::Throw, "Throw", THROW_COLOR),
                button(ButtonFunction::Despawn, "Despawn Dice", DESPAWN_COLOR),
            ],
        ))
        .id();
        )],
    ));

    let dropdown = commands
        .spawn((
            Node {
                width: Val::Percent(100.0),
                height: Val::Percent(100.0),
                flex_direction: FlexDirection::Column,
                padding: UiRect::all(Val::Px(8.0)),
                overflow: Overflow::scroll_y(),
                ..Default::default()
            },


@@ 297,17 305,4 @@ fn setup(mut commands: Commands) {
            format!("{:?}", variant),
        ));
    }

    let layout = commands
        .spawn((Node {
            width: Val::Percent(100.0),
            height: Val::Percent(100.0),
            flex_direction: FlexDirection::Column,
            align_items: AlignItems::FlexEnd,
            justify_content: JustifyContent::SpaceBetween,
            padding: UiRect::all(Val::Px(8.0)),
            ..Default::default()
        },))
        .id();
    commands.entity(layout).add_children(&[dropdown, buttons]);
}