public class ShrinkPartViewport extends com.badlogic.gdx.utils.viewport.ScalingViewport
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).
Modifier and Type | Field and Description |
---|---|
float |
barWidth |
Constructor and Description |
---|
ShrinkPartViewport(float worldWidth,
float worldHeight,
float barWidth)
Creates a new viewport using a new
OrthographicCamera . |
ShrinkPartViewport(float worldWidth,
float worldHeight,
float barWidth,
com.badlogic.gdx.graphics.Camera camera) |
Modifier and Type | Method and Description |
---|---|
com.badlogic.gdx.utils.Scaling |
getScaling() |
void |
update(int screenWidth,
int screenHeight,
boolean centerCamera) |
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
public float barWidth
public ShrinkPartViewport(float worldWidth, float worldHeight, float barWidth)
OrthographicCamera
.public ShrinkPartViewport(float worldWidth, float worldHeight, float barWidth, com.badlogic.gdx.graphics.Camera camera)
public void update(int screenWidth, int screenHeight, boolean centerCamera)
update
in class com.badlogic.gdx.utils.viewport.ScalingViewport
public com.badlogic.gdx.utils.Scaling getScaling()
getScaling
in class com.badlogic.gdx.utils.viewport.ScalingViewport
Copyright © 2012–2016. All rights reserved.