Package com.samsthenerd.inline.utils
Record Class SpriteUVRegion
java.lang.Object
java.lang.Record
com.samsthenerd.inline.utils.SpriteUVRegion
A data class storing UV coordinates to refer to a specific region.
All values should be between 0 and 1.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSpriteUVRegion(double minU, double minV, double maxU, double maxV) Creates an instance of aSpriteUVRegionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionasLens()Returns a lens which focuses based on this.final booleanIndicates whether some other object is "equal to" this one.focusWith(SpriteUVRegion luvs) Applies the given UVs to this such that the new UVs are inside of this.final inthashCode()Returns a hash code value for this object.doublemaxU()Returns the value of themaxUrecord component.doublemaxV()Returns the value of themaxVrecord component.doubleminU()Returns the value of theminUrecord component.doubleminV()Returns the value of theminVrecord component.final StringtoString()Returns a string representation of this record class.doubleuWidth()doublevHeight()
-
Field Details
-
FULL
-
-
Constructor Details
-
SpriteUVRegion
public SpriteUVRegion(double minU, double minV, double maxU, double maxV) Creates an instance of aSpriteUVRegionrecord class.- Parameters:
minU- the value for theminUrecord componentminV- the value for theminVrecord componentmaxU- the value for themaxUrecord componentmaxV- the value for themaxVrecord component
-
-
Method Details
-
uWidth
public double uWidth() -
vHeight
public double vHeight() -
focusWith
Applies the given UVs to this such that the new UVs are inside of this. -
asLens
Returns a lens which focuses based on this. -
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. All components in this record class are compared with '=='. -
minU
public double minU()Returns the value of theminUrecord component.- Returns:
- the value of the
minUrecord component
-
minV
public double minV()Returns the value of theminVrecord component.- Returns:
- the value of the
minVrecord component
-
maxU
public double maxU()Returns the value of themaxUrecord component.- Returns:
- the value of the
maxUrecord component
-
maxV
public double maxV()Returns the value of themaxVrecord component.- Returns:
- the value of the
maxVrecord component
-