Package com.badlogic.gdx.utils.viewport
Class FitViewport
- java.lang.Object
-
- com.badlogic.gdx.utils.viewport.Viewport
-
- com.badlogic.gdx.utils.viewport.ScalingViewport
-
- com.badlogic.gdx.utils.viewport.FitViewport
-
public class FitViewport extends ScalingViewport
A ScalingViewport that usesScaling.fitso it keeps the aspect ratio by scaling the world up to fit the screen, adding black bars (letterboxing) for the remaining space.
-
-
Constructor Summary
Constructors Constructor Description FitViewport(float worldWidth, float worldHeight)Creates a new viewport using a newOrthographicCamera.FitViewport(float worldWidth, float worldHeight, Camera camera)
-
Method Summary
-
Methods inherited from class com.badlogic.gdx.utils.viewport.ScalingViewport
getScaling, setScaling, update
-
Methods inherited from class com.badlogic.gdx.utils.viewport.Viewport
apply, apply, calculateScissors, getBottomGutterHeight, getCamera, getLeftGutterWidth, getPickRay, getRightGutterWidth, getRightGutterX, getScreenHeight, getScreenWidth, getScreenX, getScreenY, getTopGutterHeight, getTopGutterY, getWorldHeight, getWorldWidth, project, project, setCamera, setScreenBounds, setScreenHeight, setScreenPosition, setScreenSize, setScreenWidth, setScreenX, setScreenY, setWorldHeight, setWorldSize, setWorldWidth, toScreenCoordinates, unproject, unproject, update
-
-
-
-
Constructor Detail
-
FitViewport
public FitViewport(float worldWidth, float worldHeight)Creates a new viewport using a newOrthographicCamera.
-
FitViewport
public FitViewport(float worldWidth, float worldHeight, Camera camera)
-
-