This question already has an answer here:
I'm a beginner in libgdx, and I'm trying to create my first game. It's pretty simple, circles are falling from the top and sides of the screen, and the user needs to "blow" them before they touch the ground. It is a single screen game, where the world isn't moving, like Tetris.
My problem is that I'm having bad time understanding what viewports should I use, and when.
So, what viewport should I use for this type of game, without generating black bars or stretching the graphics? Will it be possible to check the screen width and height, and act accordingly? let's say the screen is 400x800, can I save it in the code and just spawn the circles out of the screen?
Again, I don't want my graphics to be stretched, since the circles will look weird.