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

When using canvas to display pictures, the edges of pictures are blurred #1211

Open
zhaogang96 opened this issue Mar 2, 2020 · 1 comment

Comments

@zhaogang96
Copy link

When using canvas to display pictures, the edges of pictures are blurred
It looks like this
1

There is my code

  Crafty.init(SCREEN_WIDTH, SCREEN_HEIGHT, document.querySelector("#game"));

  Crafty.sprite(621, 621, "img/wheel.png", {
    wheel: [0, 0]
  });

  // use canvas
  Crafty.e("2D, Canvas, wheel").attr({
    x: 0,
    y: 0,
    w: 100,
    h: 100
  });

  // use dom
  Crafty.e("2D, DOM, wheel").attr({
    x: 101,
    y: 101,
    h: 100,
    w: 100
  });
  Crafty.background("rgb(0,0,0)");

Is there any solution?

@rBok6
Copy link

rBok6 commented Mar 28, 2020

Check this, I hope that helps:

http://craftyjs.com/api/Crafty-pixelart.html

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

2 participants