Record Class TextureAtlasScale

java.lang.Object
java.lang.Record
dev.pfaff.altargui.texture.TextureAtlasScale

public record TextureAtlasScale(byte xShiftByte, byte yShiftByte) extends Record
  • Field Details

  • Constructor Details

    • TextureAtlasScale

      public TextureAtlasScale(byte xShiftByte, byte yShiftByte)
      Creates an instance of a TextureAtlasScale record class.
      Parameters:
      xShiftByte - the value for the xShiftByte record component
      yShiftByte - the value for the yShiftByte record component
  • Method Details

    • fromAtlasSize

      public static TextureAtlasScale fromAtlasSize(int width, int height)
    • xShift

      public int xShift()
    • yShift

      public int yShift()
    • atlasWidth

      public int atlasWidth()
    • atlasHeight

      public int atlasHeight()
    • pixelsToAtlasX

      public char pixelsToAtlasX(char x)
    • pixelsToAtlasY

      public char pixelsToAtlasY(char y)
    • atlasToPixelsX

      public char atlasToPixelsX(char x)
    • atlasToPixelsY

      public char atlasToPixelsY(char y)
    • pixelsToAtlasX

      public int pixelsToAtlasX(int x)
    • pixelsToAtlasY

      public int pixelsToAtlasY(int y)
    • atlasToPixelsX

      public int atlasToPixelsX(int x)
    • atlasToPixelsY

      public int atlasToPixelsY(int y)
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • xShiftByte

      public byte xShiftByte()
      Returns the value of the xShiftByte record component.
      Returns:
      the value of the xShiftByte record component
    • yShiftByte

      public byte yShiftByte()
      Returns the value of the yShiftByte record component.
      Returns:
      the value of the yShiftByte record component