bevy_pixel_camera
bevy_pixel_camera copied to clipboard
Drawing shapes at the right resolution
For example, this draws a simple circle at the centre of the screen:
commands.spawn(MaterialMesh2dBundle {
mesh: meshes.add(shape::Circle::new(50.).into()).into(),
material: materials.add(ColorMaterial::from(Color::BLACK)),
transform: Transform::from_translation(Vec3::new(0., 0., 0.)),
..default()
});
But this does not draw shapes at the resolution set by PixelCameraBundle. How do you adjust it so that it draws shapes at the right resolution?
This is currently not possible with this crate, which can only display pixel art images (I should make that clearer in the readme).
In order to render vector shapes at low resolution, you need to use an off-screen render target. See this example in the bevy repo; the example is in 3d but the same technique should word for 2d.
I might add this functionality later, but I'm not sure when.
Yeah, I went with the off-screen method and found it a better fit for what I'm trying to do. I'll leave this issue as is since it seems that you're open to the possibility of implementing it in the future.