Class ScalingViewport

  • Direct Known Subclasses:
    FillViewport, FitViewport, StretchViewport

    public class ScalingViewport
    extends Viewport
    A viewport that scales the world using Scaling.

    Scaling.fit keeps the aspect ratio by scaling the world up to fit the screen, adding black bars (letterboxing) for the remaining space.

    Scaling.fill keeps the aspect ratio by scaling the world up to take the whole screen (some of the world may be off screen).

    Scaling.stretch does not keep the aspect ratio, the world is scaled to take the whole screen.

    Scaling.none keeps the aspect ratio by using a fixed size world (the world may not fill the screen or some of the world may be off screen).