bevy_nine_slice_ui 0.1.0

A nine slice ui plugin for bevy ui nodes
Documentation

Bevy nine slice/patch Material Plugin

Quick and easy auto-scaling nine slice/patch material for bevy ui nodes implemented as Fragment Shader.

Usage

It's a single component.

app.add_plugin(NineSliceUiPlugin::default());
fn spawn_ui(mut cmd: Commands, server: Res<AssetServer>) {
    commands.spawn(NodeBundle {
        style: Style {
            width: Val::Percent(100.),
            height: Val::Percent(50.),
            display: Display::Flex,
            ..default()
        },
        ..default()
    })
    .insert(NineSliceTexture::new(server.load("panel.png")));
}

Check out the example

cargo run --example ui

original

Source

result

Example

Compatibility

  • Bevy 0.12