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 aSpriteUVRegion
record class. -
Method Summary
Modifier and TypeMethodDescriptionasLens()
Returns a lens which focuses based on this.final boolean
Indicates 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 int
hashCode()
Returns a hash code value for this object.double
maxU()
Returns the value of themaxU
record component.double
maxV()
Returns the value of themaxV
record component.double
minU()
Returns the value of theminU
record component.double
minV()
Returns the value of theminV
record component.final String
toString()
Returns a string representation of this record class.double
uWidth()
double
vHeight()
-
Field Details
-
FULL
-
-
Constructor Details
-
SpriteUVRegion
public SpriteUVRegion(double minU, double minV, double maxU, double maxV) Creates an instance of aSpriteUVRegion
record class.- Parameters:
minU
- the value for theminU
record componentminV
- the value for theminV
record componentmaxU
- the value for themaxU
record componentmaxV
- the value for themaxV
record 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 theminU
record component.- Returns:
- the value of the
minU
record component
-
minV
public double minV()Returns the value of theminV
record component.- Returns:
- the value of the
minV
record component
-
maxU
public double maxU()Returns the value of themaxU
record component.- Returns:
- the value of the
maxU
record component
-
maxV
public double maxV()Returns the value of themaxV
record component.- Returns:
- the value of the
maxV
record component
-