i am new to libGDX and I just wanted to put a image onto the screen. I have a red ball image which is 800x800 and when i try draw the texture:
batch.draw(ball,50,50,50,50);
The quality of the ball is really bad, but when I don't scale it down, the quality is good.
Here is a image on what I see on the screen:http://prntscr.com/55oars
Any help on how to make the images more crisp and smoother?
From what I know you have two options.
One option is to have a FitViewport and constantly maintain your screen to be the same size which would ultimately preserve the quality of your images. In this case the
FitViewport
class would help you do this by adding black bars on the screen to take care of the extra space. Example:Another option is to have a TexturePacker and load images that are proportional for a given screen.
All in all while these approaches may seem a bit tedious they really are a better way to maintain "crisp and smooth" pictures throughout different screen sizes.
It is worth remembering that by resizing the image, you actually reduce the pixel count of the photo. Therefore when you try to resize the image some pixels are "lost" and the original texture cannot be reproduced hence loss of clarity.