3

Currently I am working on a 2D Game using JavaFX, the game is pixel art. Unfortunetly, the pixel art is blurry, caused by Antialiasing.

Is there any way to disable antialiasing on a JavaFX canvas? I've tried using SceneAntialiasing.DISABLED and It didn't work. I can't find any other way of disabling it.

BlockFade
  • 31
  • 2

1 Answers1

4
canvas.getGraphicsContext2D().setImageSmoothing(false);

(Since JavaFX 12).

micycle
  • 3,328
  • 14
  • 33