Record Class LoadableTex2d

java.lang.Object
java.lang.Record
dev.pfaff.altargui.LoadableTex2d

public record LoadableTex2d(LoadableTexture tex, Tex2d coords) extends Record
  • Constructor Details

    • LoadableTex2d

      public LoadableTex2d(LoadableTexture tex, Tex2d coords)
      Creates an instance of a LoadableTex2d record class.
      Parameters:
      tex - the value for the tex record component
      coords - the value for the coords record component
    • LoadableTex2d

      public LoadableTex2d(LoadableTexture tex)
      Returns a new instance specifying the entire region of the provided texture.
  • Method Details

    • fromPixelCoords

      public static LoadableTex2d fromPixelCoords(LoadableTexture tex, int u1_i, int v1_i, int u2_i, int v2_i, int textureWidth, int textureHeight)
    • fromPixelExtent

      public static LoadableTex2d fromPixelExtent(LoadableTexture tex, int u, int v, int uExtent, int vExtent, int textureWidth, int textureHeight)
    • 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 Objects::equals(Object,Object).
      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.
    • tex

      public LoadableTexture tex()
      Returns the value of the tex record component.
      Returns:
      the value of the tex record component
    • coords

      public Tex2d coords()
      Returns the value of the coords record component.
      Returns:
      the value of the coords record component