Enum Class Align

java.lang.Object
java.lang.Enum<Align>
de.gurkenlabs.litiengine.Align
All Implemented Interfaces:
Serializable, Comparable<Align>, Constable

public enum Align extends Enum<Align>
The enum Align defines a range of horizontal alignments.
  • Enum Constant Details

    • CENTER

      public static final Align CENTER
    • LEFT

      public static final Align LEFT
    • CENTER_LEFT

      public static final Align CENTER_LEFT
    • CENTER_RIGHT

      public static final Align CENTER_RIGHT
  • Method Details

    • values

      public static Align[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Align valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • get

      public static Align get(String alignString)
      Gets the align enumeration value for the specified string.
      Parameters:
      alignString - The string representing the enum value.
      Returns:
      The enum value represented by the specified string or CENTER if the specified string is invalid.
    • getValue

      public float getValue(float width)
      Gets the proportional value of this instance.
      Parameters:
      width - The width to calculate the relative value from.
      Returns:
      The proportional value for the specified height.
    • getValue

      public double getValue(double width)
      Gets the proportional value of this instance.
      Parameters:
      width - The width to calculate the relative value from.
      Returns:
      The proportional value for the specified height.
    • getValue

      public int getValue(int width)
      Gets the proportional value of this instance.
      Parameters:
      width - The width to calculate the relative value from.
      Returns:
      The proportional value for the specified height.
    • getLocation

      public double getLocation(double width, double objectWidth)
      Gets the location for the specified object height to be horizontally aligned within the bounds of the specified width.
      Parameters:
      width - The width, limiting the horizontal alignment.
      objectWidth - The width of the object for which to calculate the horizontally aligned location.
      Returns:
      The x-coordinate for the location of the object with the specified width.