Class Resolution

java.lang.Object
de.gurkenlabs.litiengine.gui.screens.Resolution

public class Resolution
extends java.lang.Object
Represents the resolution of the game window consisting of the width and height and information about the ratio.

This class also provides access to predefined known resolutions of the different aspect ratios which can be used to set the resolution of the GameWindow.

See Also:
GameWindow.setResolution(Resolution)
  • Nested Class Summary

    Nested Classes 
    Modifier and TypeClassDescription
    static class Resolution.Ratio 
    static class Resolution.Ratio16x10
    Contains predefined Resolutions with an aspect ratio of 16:10.
    static class Resolution.Ratio16x9
    Contains predefined Resolutions with an aspect ratio of 16:9.
    static class Resolution.Ratio4x3
    Contains predefined Resolutions with an aspect ratio of 4:3.
    static class Resolution.Ratio5x4
    Contains predefined Resolutions with an aspect ratio of 5:4.
  • Method Summary

    Modifier and TypeMethodDescription
    static Resolutioncustom​(int width, int height, java.lang.String resolutionName) 
    java.awt.DimensiongetDimension()
    Gets the dimension of this resolution consisting of it's width and height.
    intgetHeight()
    Gets the height of this resolution.
    Resolution.RatiogetRatio()
    Gets the aspect ratio of this resolution.
    intgetWidth()
    Gets the width of this resolution.
    java.lang.StringtoDimensionString() 
    java.lang.StringtoDimensionString​(java.lang.String delimiter) 
    java.lang.StringtoString() 

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • custom

      public static Resolution custom​(int width, int height, java.lang.String resolutionName)
    • getHeight

      public int getHeight()
      Gets the height of this resolution.
      Returns:
      The height of the resolution.
    • getWidth

      public int getWidth()
      Gets the width of this resolution.
      Returns:
      The width of the resolution.
    • getDimension

      public java.awt.Dimension getDimension()
      Gets the dimension of this resolution consisting of it's width and height.
      Returns:
      The dimension of the resolution.
    • toDimensionString

      public java.lang.String toDimensionString()
    • toDimensionString

      public java.lang.String toDimensionString​(java.lang.String delimiter)
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • getRatio

      public Resolution.Ratio getRatio()
      Gets the aspect ratio of this resolution.
      Returns:
      The aspect ratio of this resolution.