#camera #bevy #pixel #rendering

bevy_retro_camera

Scaled pixel-perfect rendering camera for Bevy

4 releases (stable)

1.1.0 Aug 25, 2022
1.0.1 Aug 24, 2022
0.1.0 Aug 24, 2022

#2337 in Game dev

MIT license

29KB
60 lines

Bevy Retro Camera

Crates.io Docs.rs lines of code

( Screenshot of Epic RPG World - Ancient Ruins rendered with Bevy and this crate )

Epic RPG screenshot

Bevy Retro camera is a 2D, pixel-perfect camera for Bevy. It does work for Bevy 0.8.

Features

  • Easy to configure camera optimized for 2D pixel-art rendering.
  • Plugin that improve Bevy's rendering for pixel art -> Will save you hours of "Why my pixels are blurs ?"

Quickstart

Create a startup system and use RetroCameraBundle to create a camera. It's also recommended to add the RetroCameraPlugin to disable the blur effect due to Bevy's default rendering configuration.

// Add RetroCameraPlugin to you app + a startup system
fn main() {
    App::new()
        .add_plugin(RetroCameraPlugin)
        .add_startup_system(setup)
}

// Configure your startup system
fn setup(mut commands: Commands) {
    let height: f32 = 240.0;  // Viewport size
    let scale: f32 = 1.0;  // Viewport scaling factor
    commands.spawn_bundle(RetroCameraBundle::fixed_height(height, scale));
}

Compatibility matrix

Bevy bevy_retro_camera
0.8 1.0

Inspired by

Dependencies

~29–44MB
~744K SLoC