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
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 Summary
ConstructorDescriptionFitViewport
(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 Details
-
FitViewport
public FitViewport(float worldWidth, float worldHeight) Creates a new viewport using a newOrthographicCamera
. -
FitViewport
-