Crate bevy_flicker

source ·
Expand description

This plugin facilitates creating a brief overlay/mix of a specific color over a sprite or mesh.

To trigger a flicker, you can send a FlickerStartEvent, which will contain the parameters that dictate the color, length, and strength of the flicker.

Included is also a RepeatingFlicker component that will send FlickerStartEvents on an interval.

This also works on textures with alpha, the overlay takes into account the alpha of the underlying texture and will adjust the overlay alpha so that it’s intensity is proportional between different underlying alpha values. So an underlying 0.2 alpha value will reduce the alpha of the overlay by 80%. For alpha values of 0, the overlay’s alpha will also be 0.

See more, complete examples here

use bevy_flicker::prelude::*;

fn tick(query: Query<Entity>, mut event_writer: EventWriter<FlickerStartEvent>) {
    for e in query.iter() {
        event_writer.send(
            FlickerStartEvent::builder(e)
                .with_secs(0.5)
                .with_color(Color::rgba(0.0, 0.0, 1.0, 0.2))
                .build(),
        );
    }
}

Modules§

Structs§

  • The bevy plugin to include during App initialization
  • The SystemSet that the flicker systems belong to.