Class ScalingViewport

java.lang.Object
arc.util.viewport.Viewport
arc.util.viewport.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).

  • Constructor Details

    • ScalingViewport

      public ScalingViewport(Scaling scaling, float worldWidth, float worldHeight)
      Creates a new viewport using a new Camera.
    • ScalingViewport

      public ScalingViewport(Scaling scaling, float worldWidth, float worldHeight, Camera camera)
  • Method Details