An event-based plugin for the Bevy game engine that provides a simple way to add a despawn effect for 2D sprites. Contains a basic physics implementation or a feature for bevy_rapier integration.
```rust use bevy::prelude::; use bevy_despawn_particles::prelude::;
pub struct Marker;
fn main() { App::new() .addplugins(DefaultPlugins) .addplugin(DespawnParticlesPlugin) .addsystem(setup.onstartup()) .add_system(despawn) .run(); }
fn setup(mut commands: Commands, assetserver: Res
fn despawn(
mut despawnparticleseventwriter: EventWriter
```
All the following examples can be found in the examples directory of this repository.
| cargo run --release --example the_works
|
|:--:|
| This example utilizes most of the parameters available. The particles fade and shrink, have a mass affected by gravity, shoot outwards and have some amount of angular velocity, and dampening. |
||
| cargo run --release --example fade
|
|:--:|
| In this example the particles are stationary and just fade, giving the visual effect of the entire sprite just fading away |
||
| cargo run --release --example shrink
|
|:--:|
| In this example the particles are stationary and just shrink in place |
||
| cargo run --release --example velocity
|
|:--:|
| In this example the particles shoot outwards from the sprite |
||
| cargo run --release --example mesh
|
|:--:|
| Can be utilized on a Mesh. Also includes usage of the faux circle mesh to replace the arguably unappealing triangles that typically make up a Cirlcle mesh |
||