Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawing shapes at the right resolution #30

Open
musjj opened this issue Oct 1, 2023 · 2 comments
Open

Drawing shapes at the right resolution #30

musjj opened this issue Oct 1, 2023 · 2 comments
Labels
enhancement New feature or request maybe Need further investigation

Comments

@musjj
Copy link

musjj commented Oct 1, 2023

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?

@drakmaniso
Copy link
Owner

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.

@musjj
Copy link
Author

musjj commented Oct 2, 2023

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.

@drakmaniso drakmaniso added enhancement New feature or request maybe Need further investigation labels Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maybe Need further investigation
Projects
None yet
Development

No branches or pull requests

2 participants