Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Nov 15, 2024
1 parent 807c837 commit dded476
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,21 @@
[![Bevy Tracking](https://img.shields.io/badge/Bevy%20tracking-main-lightblue)](https://github.com/bevyengine/bevy/blob/main/docs/plugins_guidelines.md#main-branch-tracking)
[![CI](https://github.com/vleue/bevy_streamdeck/actions/workflows/ci.yml/badge.svg)](https://github.com/vleue/bevy_streamdeck/actions/workflows/ci.yml)


[Elgato Stream Deck](https://www.elgato.com/en/stream-deck) plugin for [Bevy](https://bevyengine.org).
This is a plugin for integrating the [Elgato Stream Deck](https://www.elgato.com/en/stream-deck) with the [Bevy](https://bevyengine.org) game engine. It allows you to handle input events from the Stream Deck and control its display.

![capture of a Stream Deck](https://raw.githubusercontent.com/vleue/bevy_streamdeck/main/capture.png)

Add the plugin:
## Getting Started

### Adding the Plugin

```rust
app.add_plugin(StreamDeckPlugin);
```

Receive events from button press (see [inputs example](./examples/inputs.rs)):
```rust
fn print_streamdeck_events(mut streamdeck_input_events: EventReader<StreamDeckInput>) {
for event in streamdeck_input_events.iter() {
info!("{:?}", event);
}
}
```
### Handling Input Events

Receive events from button press (see [inputs example](https://github.com/vleue/bevy_streamdeck/blob/main/examples/inputs.rs)):
Receive events from button presses (see [inputs example](https://github.com/vleue/bevy_streamdeck/blob/main/examples/inputs.rs)):
```rust
fn print_streamdeck_events(mut streamdeck_input_events: EventReader<StreamDeckInput>) {
for event in streamdeck_input_events.iter() {
Expand All @@ -35,15 +29,19 @@ fn print_streamdeck_events(mut streamdeck_input_events: EventReader<StreamDeckIn
}
```

Set a button color (see [colors example](https://github.com/vleue/bevy_streamdeck/blob/main/examples/colors.rs))
### Setting Button Colors

Set a button color (see [colors example](https://github.com/vleue/bevy_streamdeck/blob/main/examples/colors.rs)):
```rust
fn set_color(streamdeck: Res<StreamDeck>) {
streamdeck.set_key_color(1, Color::BLUE);
}

```

Display an image on a button (see [image example](https://github.com/vleue/bevy_streamdeck/blob/main/examples/image.rs))
### Displaying Images

Display an image on a button (see [image example](https://github.com/vleue/bevy_streamdeck/blob/main/examples/image.rs)):
```rust
fn set_image(streamdeck: Res<StreamDeck>, logo: Res<Logo>, images: Res<Assets<Image>>) {
let handle: Handle<Image> = ...;
Expand All @@ -54,11 +52,15 @@ fn set_image(streamdeck: Res<StreamDeck>, logo: Res<Logo>, images: Res<Assets<Im
```


## Linux Setup
## Platform-Specific Setup

### Linux

For Linux setup, please refer to the [rust-streamdeck getting started guide](https://github.com/ryankurte/rust-streamdeck#getting-started).

see https://github.com/ryankurte/rust-streamdeck#getting-started
## Compatibility

## Bevy Compatibility
### Bevy Compatibility

|Bevy|bevy_streamdeck|
|---|---|
Expand Down

0 comments on commit dded476

Please sign in to comment.