Package com.samsthenerd.inline.utils
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.samsthenerd.inline.utils.SpriteUVLens
SpriteUVLens.AnimUVLens -
Constructor Summary
ConstructorsConstructorDescriptionAnimUVLens(double frameSize, boolean isVertical, int[] delays) AnimUVLens(double frameSize, boolean isVertical, int[] delays, int totalLength) Creates an instance of aAnimUVLensrecord class. -
Method Summary
Modifier and TypeMethodDescriptionint[]delays()Returns the value of thedelaysrecord component.final booleanIndicates whether some other object is "equal to" this one.focusUVs(SpriteUVRegion uvs, long time) Apply a lens to a given UV region.doubleReturns the value of theframeSizerecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisVerticalrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalLengthrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.samsthenerd.inline.utils.SpriteUVLens
andThen, genUVs
-
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 aAnimUVLensrecord class.- Parameters:
frameSize- the value for theframeSizerecord componentisVertical- the value for theisVerticalrecord componentdelays- the value for thedelaysrecord componenttotalLength- the value for thetotalLengthrecord component
-
-
Method Details
-
focusUVs
Description copied from interface:SpriteUVLensApply a lens to a given UV region.- Specified by:
focusUVsin interfaceSpriteUVLens- Parameters:
uvs- base region to start from. SeeSpriteUVRegion.FULLto start with.time- in milliseconds, used for animated region calculations. SeeSpriteUVLens.getSysTime()for a usable input.
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
frameSize
public double frameSize()Returns the value of theframeSizerecord component.- Returns:
- the value of the
frameSizerecord component
-
isVertical
public boolean isVertical()Returns the value of theisVerticalrecord component.- Returns:
- the value of the
isVerticalrecord component
-
delays
public int[] delays()Returns the value of thedelaysrecord component.- Returns:
- the value of the
delaysrecord component
-
totalLength
public int totalLength()Returns the value of thetotalLengthrecord component.- Returns:
- the value of the
totalLengthrecord component
-