com.badlogic.gdx.utils.viewport.FitViewport Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gdx Show documentation
Show all versions of gdx Show documentation
Android/Desktop/iOS/HTML5 game development framework
package com.badlogic.gdx.utils.viewport;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.utils.Scaling;
/** A ScalingViewport that uses {@link 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.
* @author Daniel Holderbaum
* @author Nathan Sweet */
public class FitViewport extends ScalingViewport {
/** Creates a new viewport using a new {@link OrthographicCamera}. */
public FitViewport (float worldWidth, float worldHeight) {
super(Scaling.fit, worldWidth, worldHeight);
}
public FitViewport (float worldWidth, float worldHeight, Camera camera) {
super(Scaling.fit, worldWidth, worldHeight, camera);
}
}