Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/celerysaltgames/bevy_retro_camera
Scaled pixel-perfect rendering camera for Bevy
https://github.com/celerysaltgames/bevy_retro_camera
bevy bevy-plugin bevy-retrograde camera pixel-perfect rendering
Last synced: about 1 month ago
JSON representation
Scaled pixel-perfect rendering camera for Bevy
- Host: GitHub
- URL: https://github.com/celerysaltgames/bevy_retro_camera
- Owner: celerysaltgames
- License: mit
- Created: 2022-08-24T18:43:20.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-26T08:33:04.000Z (over 2 years ago)
- Last Synced: 2024-10-10T22:39:47.407Z (2 months ago)
- Topics: bevy, bevy-plugin, bevy-retrograde, camera, pixel-perfect, rendering
- Language: Rust
- Homepage: https://crates.io/crates/bevy_retro_camera
- Size: 429 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bevy Retro Camera
[![Crates.io](https://img.shields.io/crates/v/bevy_retro_camera.svg)](https://crates.io/crates/bevy_retro_camera)
[![Docs.rs](https://docs.rs/bevy_retro_camera/badge.svg)](https://docs.rs/bevy_retro_camera)
[![lines of code](https://tokei.rs/b1/github/celerysaltgames/bevy_retro_camera?category=code)](https://github.com/celerysaltgames/bevy_retro_camera)![Epic RPG screenshot](./docs/images/epic_rpg.png)
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.```rust
// 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
- The excellent [Bevy Cheatbook](https://bevy-cheatbook.github.io/cookbook/custom-projection.html) about custom projections.
- Bevy's [Camera and Viewport update](https://github.com/bevyengine/bevy/commit/ae0ccfb4f6d41d2033be03b48e2538d1cf0cd86f).
- The _RetroCameraBundle_ of [Bevy Retrograde](https://crates.io/crates/bevy_retrograde)