Bevy Button Released plugin

This crate makes Bevy application aware of the release of the button instead of reacting right after clicking. I think it will be addressed in next release but until then it could be helpful for some people.

Install

``` cargo add bevybuttonreleased_plugin

```

Usage

Add ButtonsReleasedPlugin during app creation process, GameButton component to buttons that you want to react to it like in button_system function in example below.

```rust use bevy::prelude::*; use bevybuttonreleased_plugin::{ButtonReleasedEvent, ButtonsReleasedPlugin, GameButton};

pub fn main() { let mut app = App::new(); app.addplugins(DefaultPlugins) .addplugin(ButtonsReleasedPlugin) .addstartupsystem(setup) .addsystem(buttonsystem); app.run(); }

fn buttonsystem(mut reader: EventReader, q: Query<&Name>) { for event in reader.iter() { if let Ok(buttonname) = q.get(**event) { info!("Button released: {}", button_name); } } }

fn setup(mut commands: Commands) { // Camera commands.spawn(Camera2dBundle::default());

// root node
commands
    .spawn(NodeBundle {
        style: Style {
            size: Size::width(Val::Percent(100.0)),
            justify_content: JustifyContent::SpaceEvenly,
            flex_direction: FlexDirection::Column,
            ..default()
        },
        ..default()
    })
    .with_children(|parent| {
        for (text, color) in [
            ("GreenButton", Color::GREEN),
            ("RedButton", Color::ORANGE_RED),
            ("YellowButton", Color::YELLOW),
        ] {
            parent.spawn((
                ButtonBundle {
                    style: Style {
                        margin: UiRect::all(Val::Px(18.0)),
                        padding: UiRect::all(Val::Px(30.0)),
                        ..default()
                    },
                    background_color: BackgroundColor(color),
                    ..default()
                },
                GameButton::default(),
                Name::new(text),
            ));
        }
    });

} ```

Bevy compatibility table

Bevy version | crate version --- | --- 0.10 | 0.1.0