Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: SoftwareCursor

[14:7] extends: FxObj

Wraps FXGL's SoftwareCursor, a custom cursor (rendered as a triangular Polygon by default) for fullscreen games that hide the OS cursor. The wrapped object is the SoftwareCursor holder; call getCursorNode to retrieve the underlying JavaFX Node to add to the scene.

Methods

  • SoftwareCursor (object ColorObj)

    Creates a new SoftwareCursor with the given fill color.

    • @p ColorObj is a Color wrapper for the cursor fill.
  • getCursorNode ()

    Returns the underlying JavaFX Node to add to the scene.

    • @r An AussomJavaObject around a javafx.scene.Node.
  • setPositionX (double X)

    Sets the cursor X position in scene coordinates.

    • @p X is the X coordinate.
    • @r this object
  • setPositionY (double Y)

    Sets the cursor Y position in scene coordinates.

    • @p Y is the Y coordinate.
    • @r this object
  • setPosition (double X, double Y)

    Sets the cursor position. Call this from a mouse-move event handler so the cursor follows the input.

    • @p X is the X coordinate.
    • @p Y is the Y coordinate.
    • @r this object
  • translatePositionX (double Dx)

    Translates the cursor by the supplied X delta.

    • @p Dx is the X delta.
    • @r this object
  • translatePositionY (double Dy)

    Translates the cursor by the supplied Y delta.

    • @p Dy is the Y delta.
    • @r this object
  • translatePosition (double Dx, double Dy)

    Translates the cursor by (Dx, Dy).

    • @p Dx is the X delta.
    • @p Dy is the Y delta.
    • @r this object
  • setShape (list Points, object ColorObj)

    Replaces this cursor's shape with the given polygon points (paired X, Y values in scene coordinates) and fill color. Useful when the default triangular cursor is not the desired silhouette. Implementation note: the underlying FXGL constructor takes Double[] + Color; this helper constructs a fresh cursor and swaps its backing object into this wrapper so existing method calls continue to work.

    • @p Points is a list of doubles in [x0, y0, x1, y1, ...] order.
    • @p ColorObj is a Color wrapper.
    • @r this object