Class FitViewport


public class FitViewport extends ScalingViewport
A ScalingViewport that uses Scaling.fit so it keeps the aspect ratio by scaling the world up to fit the screen, adding black bars (letterboxing) for the remaining space.
  • Constructor Details

    • FitViewport

      public FitViewport(float worldWidth, float worldHeight)
      Creates a new viewport using a new Camera.
    • FitViewport

      public FitViewport(float worldWidth, float worldHeight, Camera camera)