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

Pixel Art Extremely Blurry #516

Closed
0b01 opened this issue Nov 30, 2018 · 1 comment
Closed

Pixel Art Extremely Blurry #516

0b01 opened this issue Nov 30, 2018 · 1 comment

Comments

@0b01
Copy link

0b01 commented Nov 30, 2018

I am rendering a 32px x 32px pixel art sprite using

        let dst = graphics::Point2::new(self.pos_x as f32, self.pos_y as f32);
        let scale = graphics::Point2::new(5., 5.);
        graphics::draw_ex(ctx, &self.image1, DrawParam {
            dest: dst,
            rotation: 0.,
            scale,
            ..Default::default()
        })?;

but the result is extremely blurry:

2018-11-30-030345_800x600_scrot

@0b01
Copy link
Author

0b01 commented Nov 30, 2018

Resolved by setting FilterMode to Nearest:

        let mut image1 = graphics::Image::new(ctx, "/lettuce.png").unwrap();
        image1.set_filter(graphics::FilterMode::Nearest);

@0b01 0b01 closed this as completed Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant