Record Class GuiSoftwareCursor
java.lang.Object
java.lang.Record
com.render.api.gui.paint.GuiSoftwareCursor
- Record Components:
image- cursor imagewidth- painted widthheight- painted heighthotspotX- horizontal hotspot measured from the painted left edgehotspotY- vertical hotspot measured from the painted top edge
public record GuiSoftwareCursor(GuiImage image, float width, float height, float hotspotX, float hotspotY)
extends Record
Immutable software cursor painted above a managed
GuiView.
The image may be any reusable GuiImage, including gradients,
retained SVG, mesh gradients, and paint worklets. Size and hotspot are in
RenderLib design-space pixels. The native cursor remains visible while an
asynchronous raster or SVG image is still loading.
-
Constructor Summary
ConstructorsConstructorDescriptionGuiSoftwareCursor(GuiImage image, float width, float height, float hotspotX, float hotspotY) Creates an instance of aGuiSoftwareCursorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic GuiSoftwareCursorCreates a cursor whose hotspot is centered.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatheight()Returns the value of theheightrecord component.floathotspotX()Returns the value of thehotspotXrecord component.floathotspotY()Returns the value of thehotspotYrecord component.image()Returns the value of theimagerecord component.static GuiSoftwareCursorCreates a cursor whose hotspot is its upper-left corner.final StringtoString()Returns a string representation of this record class.floatwidth()Returns the value of thewidthrecord component.withHotspot(float x, float y) Returns a copy with a new hotspot.
-
Constructor Details
-
GuiSoftwareCursor
Creates an instance of aGuiSoftwareCursorrecord class.
-
-
Method Details
-
of
Creates a cursor whose hotspot is its upper-left corner.- Parameters:
image- cursor imagewidth- painted widthheight- painted height- Returns:
- cursor definition
-
centered
Creates a cursor whose hotspot is centered.- Parameters:
image- cursor imagewidth- painted widthheight- painted height- Returns:
- cursor definition
-
withHotspot
Returns a copy with a new hotspot.- Parameters:
x- horizontal hotspoty- vertical hotspot- Returns:
- updated cursor
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
image
-
width
-
height
-
hotspotX
-
hotspotY
-