Record Class SpriteUVRegion

java.lang.Object
java.lang.Record
com.samsthenerd.inline.utils.SpriteUVRegion

public record SpriteUVRegion(double minU, double minV, double maxU, double maxV) extends Record
A data class storing UV coordinates to refer to a specific region. All values should be between 0 and 1.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpriteUVRegion(double minU, double minV, double maxU, double maxV)
    Creates an instance of a SpriteUVRegion record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a lens which focuses based on this.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Applies the given UVs to this such that the new UVs are inside of this.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the maxU record component.
    double
    Returns the value of the maxV record component.
    double
    Returns the value of the minU record component.
    double
    Returns the value of the minV record component.
    final String
    Returns a string representation of this record class.
    double
     
    double
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • SpriteUVRegion

      public SpriteUVRegion(double minU, double minV, double maxU, double maxV)
      Creates an instance of a SpriteUVRegion record class.
      Parameters:
      minU - the value for the minU record component
      minV - the value for the minV record component
      maxU - the value for the maxU record component
      maxV - the value for the maxV record component
  • Method Details

    • uWidth

      public double uWidth()
    • vHeight

      public double vHeight()
    • focusWith

      public SpriteUVRegion focusWith(SpriteUVRegion luvs)
      Applies the given UVs to this such that the new UVs are inside of this.
    • asLens

      public SpriteUVLens asLens()
      Returns a lens which focuses based on this.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • minU

      public double minU()
      Returns the value of the minU record component.
      Returns:
      the value of the minU record component
    • minV

      public double minV()
      Returns the value of the minV record component.
      Returns:
      the value of the minV record component
    • maxU

      public double maxU()
      Returns the value of the maxU record component.
      Returns:
      the value of the maxU record component
    • maxV

      public double maxV()
      Returns the value of the maxV record component.
      Returns:
      the value of the maxV record component