How `bevy_pixel_camera` works
mainThe bevy_pixel_camera plugin facilitates pixel-art rendering by automatically configuring Bevy's Camera2dBundle. It uses an "upscale each sprite independently" approach rather than rendering to an offscreen texture.
Key behaviors include:
- Setting the camera to an integer scaling factor using Bevy's
ScalingMode::WindowSize. - Automatically updating the zoom level so the specified target resolution fills as much of the screen as possible.
- Optionally setting and resizing the camera viewport to match the target resolution.
This method allows for smoother movement and easier mixing of pixel-art with high-resolution elements (like text or particles), though it may sacrifice the perfect pixel alignment found in offscreen texture methods.