Trying to center my game's display, need some advice!

Hello all, in my game’s core class I’m trying to center the game’s display, and it turns out looking like this.

I have a Dimension called fSize, it’s just the width/height of the user’s screen. I have another Dimension called size, which is at a minimum of 1280x800, the user can change this in the launcher options.

I am as well scaling down the game and stretching it, if you zoom into the image you’ll see that the pixels are uneven.

Here’s the current code I have for centering it. Does anyone have any help?

g.drawImage(display, (fSize.width / 2) - (size.width / 2), (fSize.height / 2) - (size.height / 2), size.width, size.height, 0, 0, size.width / 2, size.height / 2, null);

All advice is appreciated.

  • Jev.