seldom_interop

Crates.io MIT/Apache 2.0 Crates.io

seldom_interop is a crate featuring interoperability traits for Bevy components. This helps apps and third-party plugins, that use alternative components to represent concepts such as position instead of using the built-in components such as Transform, interoperate with other third-party plugins that operate on such components. It currently only features traits for positional components, and I will add more traits as needed. If you want other interoperability traits for your plugin, please submit an issue!

Features

Usage

Add to your Cargo.toml

```toml

Replace * with your desired version

[dependencies] seldom_interop = "*" ```

For apps and plugins that add components for which you would like to add interoperability, implement relevant traits for your components. For plugins that would like to use components in an interoperable way, add a type parameter to your plugin and relevant systems. For example:

```Rust use std::marker::PhantomData;

use bevy::prelude::; use seldom_interop::prelude::;

struct MyPlugin = Transform>(PhantomData);

impl> Plugin for MyPlugin { fn build(&self, app: &mut App) { app.addsystem(mysystem::); } }

fn mysystem>(mut positions: Query<&mut T>, time: Resvec = position.get(); positionvec.x += time.deltaseconds(); position.set(position_vec); } } ```

Compatibility

| Bevy | seldom_interop | | ---- | ---------------- | | 0.8 | 0.1 |

License

seldom_interop is dual-licensed under MIT and Apache 2.0 at your option.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.