I got a FitViewport with a virtual width and virtual height. When the screen got another aspect ratio than my virtual resolution black bars are added. I want to draw something inside these letterboxes.
I tried to do it that way, but only objects "inside" my virtual resolution are drawn, objects "outside" are just not visible:
viewport = new FitViewport(VIRTUAL_WIDTH, VIRTUAL_HEIGHT, cam);
viewport.apply();
batch.setProjectionMatrix(cam.combined);
batch.begin();
batch.draw(texture, viewport.getRightGutterX(), 0);
batch.end();
How to draw inside the letterboxes?