How I set up low-res/pixel-perfect rendering in libGDX
- Resizes to any screen size (adds black bars depending on aspect ratio)
- Rotation, scaling, etc. are all pixel perfect (see images below)
- First, the game renders all the sprites to an
FrameBuffer
at a set resolution - The
FrameBuffer
is then scaled to the screen size - There are two cameras, one that only looks at the
FrameBuffer
(calledfboCamera
) - The other camera (simply called
camera
), is the one that actually follows the player