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 aAnimUVLens
record class. -
Method Summary
Modifier and TypeMethodDescriptionint[]
delays()
Returns the value of thedelays
record component.final boolean
Indicates whether some other object is "equal to" this one.focusUVs
(SpriteUVRegion uvs, long time) Apply a lens to a given UV region.double
Returns the value of theframeSize
record component.final int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of theisVertical
record component.final String
toString()
Returns a string representation of this record class.int
Returns the value of thetotalLength
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 aAnimUVLens
record class.- Parameters:
frameSize
- the value for theframeSize
record componentisVertical
- the value for theisVertical
record componentdelays
- the value for thedelays
record componenttotalLength
- the value for thetotalLength
record component
-
-
Method Details
-
focusUVs
Description copied from interface:SpriteUVLens
Apply a lens to a given UV region.- Specified by:
focusUVs
in interfaceSpriteUVLens
- Parameters:
uvs
- base region to start from. SeeSpriteUVRegion.FULL
to 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 theframeSize
record component.- Returns:
- the value of the
frameSize
record component
-
isVertical
public boolean isVertical()Returns the value of theisVertical
record component.- Returns:
- the value of the
isVertical
record component
-
delays
public int[] delays()Returns the value of thedelays
record component.- Returns:
- the value of the
delays
record component
-
totalLength
public int totalLength()Returns the value of thetotalLength
record component.- Returns:
- the value of the
totalLength
record component
-