Record Class SpriteUVLens.AnimUVLens

java.lang.Object
java.lang.Record
com.samsthenerd.inline.utils.SpriteUVLens.AnimUVLens
Record Components:
frameSize - size of a single frame along the varying axis.
isVertical - determines which axis should vary. The other axis will be full (min 0, max 1).
delays - how many milliseconds each frame should appear for.
totalLength - the total number of milliseconds this gif should last for.
All Implemented Interfaces:
SpriteUVLens
Enclosing interface:
SpriteUVLens

public static record SpriteUVLens.AnimUVLens(double frameSize, boolean isVertical, int[] delays, int totalLength) extends Record implements SpriteUVLens
A lens referring to an animated region. Based on a gif.
  • Constructor Details

    • AnimUVLens

      public AnimUVLens(double frameSize, boolean isVertical, int[] delays)
    • AnimUVLens

      public AnimUVLens(double frameSize, boolean isVertical, int[] delays, int totalLength)
      Creates an instance of a AnimUVLens record class.
      Parameters:
      frameSize - the value for the frameSize record component
      isVertical - the value for the isVertical record component
      delays - the value for the delays record component
      totalLength - the value for the totalLength record component
  • Method Details

    • focusUVs

      public SpriteUVRegion focusUVs(SpriteUVRegion uvs, long time)
      Description copied from interface: SpriteUVLens
      Apply a lens to a given UV region.
      Specified by:
      focusUVs in interface SpriteUVLens
      Parameters:
      uvs - base region to start from. See SpriteUVRegion.FULL to start with.
      time - in milliseconds, used for animated region calculations. See SpriteUVLens.getSysTime() for a usable input.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • frameSize

      public double frameSize()
      Returns the value of the frameSize record component.
      Returns:
      the value of the frameSize record component
    • isVertical

      public boolean isVertical()
      Returns the value of the isVertical record component.
      Returns:
      the value of the isVertical record component
    • delays

      public int[] delays()
      Returns the value of the delays record component.
      Returns:
      the value of the delays record component
    • totalLength

      public int totalLength()
      Returns the value of the totalLength record component.
      Returns:
      the value of the totalLength record component