Record Class ImageCursor
- Record Components:
image- the cursor bitmap (straight-alpha RGBA, top-down)hotspotX- hotspot x within the image, pixels,[0, width)hotspotY- hotspot y within the image, pixels,[0, height)
Image (a themed crosshair, a
brush outline, a spell-target reticle), where the ten stock Cursor
shapes are not enough.
Widgets request one via Widget.setImageCursor(limn.backend.ImageCursor); the
scene resolves it exactly like the standard shapes (walking up from the
hovered leaf, an image cursor winning over a shape declared on the same
widget) and pushes it to the window through
NativeWindow.setImageCursor(limn.backend.ImageCursor).
The hotspot is the image pixel that sits on the click point (a crosshair
centers it; an arrow puts it at the tip). Two ImageCursors are equal when
they share the same Image instance and hotspot (images
compare by identity). Reuse one Image per cursor design, since the backend
caches the native cursor object it creates per distinct ImageCursor.
Platform note: the image is used at its pixel size 1:1 in screen coordinates; there is no HiDPI variant selection at the native layer, so on scaled displays a 32 px cursor appears visually smaller than UI content at the same nominal size. Size cursors for the display class you target.
-
Constructor Summary
ConstructorsConstructorDescriptionImageCursor(Image image, int hotspotX, int hotspotY) Creates an instance of aImageCursorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.inthotspotX()Returns the value of thehotspotXrecord component.inthotspotY()Returns the value of thehotspotYrecord component.image()Returns the value of theimagerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
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 '=='. -
image
Returns the value of theimagerecord component.- Returns:
- the value of the
imagerecord component
-
hotspotX
public int hotspotX()Returns the value of thehotspotXrecord component.- Returns:
- the value of the
hotspotXrecord component
-
hotspotY
public int hotspotY()Returns the value of thehotspotYrecord component.- Returns:
- the value of the
hotspotYrecord component
-