bevy_retro_camera

Crates.iobevy_retro_camera
lib.rsbevy_retro_camera
version1.1.0
sourcesrc
created_at2022-08-24 19:50:38.919926
updated_at2022-08-25 18:40:14.917265
descriptionScaled pixel-perfect rendering camera for Bevy
homepagehttps://github.com/celerysaltgames/bevy_retro_camera
repositoryhttps://github.com/celerysaltgames/bevy_retro_camera
max_upload_size
id651780
size96,380
Joffrey Bienvenu (Joffreybvn)

documentation

README

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

Commit count: 18

cargo fmt