Package-level declarations

Types

Link copied to clipboard
class ExtendViewport(val minWidth: Int, val minHeight: Int, var camera: Camera = OrthographicCamera()) : Viewport

A viewport that supports using a virtual size. The virtual viewport maintains the aspect ratio by extending the game world horizontally or vertically. The world is scaled to fit within the viewport and then the shorter dimension is lengthened to fill the viewport.

Link copied to clipboard
open class FillViewport(virtualWidth: Int, virtualHeight: Int, var camera: Camera = OrthographicCamera()) : ScalingViewport

A viewport that supports using a virtual size. The virtual viewport will maintain its aspect ratio but in an attempt to fill the screen parts of the viewport may be cut off. No black bars may appear.

Link copied to clipboard
open class FitViewport(virtualWidth: Int, virtualHeight: Int, var camera: Camera = OrthographicCamera()) : ScalingViewport

A viewport that supports using a virtual size. The virtual viewport will maintain its aspect ratio while attempting to fit as much as possible onto the screen. Black bars may appear.

Link copied to clipboard
open class ScalingViewport(val scaler: Scaler, virtualWidth: Int, virtualHeight: Int, var camera: Camera = OrthographicCamera()) : Viewport

A base Viewport that handles scaling to a virtual width and height.

Link copied to clipboard
class ScreenViewport(var x: Int, var y: Int, var width: Int, var height: Int, var camera: Camera = OrthographicCamera()) : Viewport

A viewport that uses a virtual size that will always match the window size. No scaling happens along with no black bars appearing.

Link copied to clipboard
open class StretchViewport(virtualWidth: Int, virtualHeight: Int, var camera: Camera = OrthographicCamera()) : ScalingViewport

A viewport that supports using a virtual size. The virtual viewport is stretched to fit the screen. There are no black bars and the aspect ratio can change after scaling.

Link copied to clipboard
open class Viewport(var x: Int = 0, var y: Int = 0, var width: Int = 0, var height: Int = 0, var camera: Camera = OrthographicCamera())

A base viewport where the virtual size is the same as the viewport/screen size.