Before I start, my first language isn’t English. So I may have issues with grammars or words.
I’m currently making pixel game and there is problem with scaling screen.
LibGDX’s OrthographicCamera is what I used for scaling screen.
Texture is used for spritesheet and PolygonSpriteBatch.draw() is used to draw on screen
Image should be 3 times bigger than original spritesheet, So I changed OrthographicCamera’s Zoom to 1/3.
(This image isn’t screenshot of what happened It’s custom drawn for explanation)
Red rectangle indicates source position used and Blue rectangle indicates problem.
Left one is spritesheet and Right one is image displayed on Screen.
Upper Image shows scaling affecting source position. When I saw this error I thought i set sourceX wrong but it wasn’t.
Only 1/3 of pixel from the sourceImage that shouldn’t be there is added on screen.
Batch’s draw method get source positions with Integer, and also It doesn’t happen when it’s not scaled
Black Rectangle shows distortion happen when scaling.
Image itself is not scaled correctly and partly distorted
These errors do not ‘always’ happen. Sometime Image is displayed correctly but sometime doesn’t.
Moving camera makes both error to settle or error to occur.
So I assume error happens only when camera is at certain Position?
So my question is, as I need to draw PixelPerfect scaled Screen, how do I resolve these errors?