Crate bevy_tiled_camera[][src]

Expand description

License: MIT docs

Bevy Tiled Camera

A simple camera for properly displaying low resolution pixel perfect 2D games in bevy.

This camera will scale up the viewport as much as possible while mainting your target resolution and avoiding pixel artifacts.


use bevy_tiled_camera::*;
use bevy::prelude::*;

fn setup(mut commands:Commands) {
  // Sets up a camera to display 80 x 25 tiles. The viewport will be scaled up
  // as much as possible to fit the window size and maintain the appearance of
  // 8 pixels per tile.
  let camera_bundle = TiledCameraBundle::new()


fn main() {

Note this is only half the work needed to avoid artifacts with low resolution pixel art. You also need to ensure the camera position and your sprite edges are aligned to the pixel grid.

You can change the camera settings at any time by adjusting the TiledProjection component on the camera entity.

World Space

Note that this projection assumes the size of one tile is equal to one world unit. This is different than Bevy’s default 2D orthographic camera which assumes one pixel is equal to one world unit.




pub use projection::TiledProjection;



Component bundle with functions to specify how you want the camera set up.