I have done some searching, but I haven’t found a satisfactory answer. How would one go about creating pixelated games using JavaFX? I am using JavaFX for the first time (cause I’m developing a game I would like to have run on the Raspberry Pi, and JavaFX seems to be the way to go performance-wise).
Anyway, when using Java2D I’d simply draw the game images onto an image, then draw that image to a canvas that is larger than the image, resulting in pixelly goodness. However, I’m new to JavaFX and don’t quite know how to do that. I created a Canvas and tried drawing images using its GraphicsContext, then scaling the canvas up by a factor of 2. This results in a blurry image, due to interpolation.
My questions are:
- Is it possible to scale a canvas without using interpolation to smooth the pixels?
- Should I even be trying to do it the way I am, or is there a better way?
- If there is a better way, what would it be?
Thanks a lot for any advice.