bevy_pixel_buffer 0.1.0

A library to draw pixels in bevy
docs.rs failed to build bevy_pixel_buffer-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: bevy_pixel_buffer-0.8.2

bevy_pixel_buffer

A library to draw pixels in bevy.

  • Easy to set up and use.
  • Can be integrated into an existing project.
  • Allows dynamic resize of the pixel buffer to fill an area such as the window.
  • Support for multiple pixel buffers.
  • Allows to easily attach a compute shader to update the pixels.
  • egui integration (through bevy_egui) to show the pixels inside the UI.

Examples

A basic example,

use bevy::prelude::*;
use bevy_pixel_buffer::prelude::*;

fn main() {
    let size = PixelBufferSize {
        size: UVec2::new(32, 32),       // amount of pixels
        pixel_size: UVec2::new(16, 16), // size of each pixel in the screen
    };

    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugin(PixelBufferPlugin)  // Add this plugin
        .add_startup_system(pixel_buffer_setup(size)) // Setup system
        .add_system(update)
        .run()
}

fn update(mut pb: QueryPixelBuffer) {
    // Set each pixel to a random color
    pb.frame().per_pixel(|_, _| Pixel::random());
}

Basic example output

More examples

Features

All features are enabled by default.

  • egui. Egui integration.
  • rayon. Enables extra alternative functions that use rayon.