XYPadElement record
Two-axis pad: a square with a grid and a centre crosshair, and a dot at the current value. A click or a drag anywhere on the pad moves the dot to the pointer and calls Set with the pointer’s value, clamped to [Min,Max] on both axes. X grows to the right and Y grows UP (math convention: the top edge is Max), so an “up” arrow beside the pad means +Y.
Like SliderElement, Set is called on every drag frame (not only on release) and there is no separate release callback: persist from Set (cheaply, e.g. a config write that coalesces) exactly as you would for a slider. Get reflects external state (poll-diffed), so the dot follows changes made elsewhere — arrow buttons, a reset. Enabled null = always enabled; while it returns false the pad is dimmed and ignores the pointer.
public record XYPadElement : IEquatable<HudElement>Public Members
Section titled “Public Members”| name | description |
|---|---|
| XYPadElement(…) | Two-axis pad: a square with a grid and a centre crosshair, and a dot at the current value. A click or a drag anywhere on the pad moves the dot to the pointer and calls Set with the pointer’s value, clamped to [Min,Max] on both axes. X grows to the right and Y grows UP (math convention: the top edge is Max), so an “up” arrow beside the pad means +Y. |
| Enabled { get; set; } | Whether the pad takes input (poll-diffed); null = always. |
| Get { get; set; } | Current value (X, Y). |
| GridLines { get; set; } | Grid divisions per axis (8 → 7 faint lines each way); 0 or 1 → no grid. The centre crosshair is always drawn. |
| Max { get; set; } | Highest value on both axes (right / top edge). |
| Min { get; set; } | Lowest value on both axes (left / bottom edge). |
| Set { get; set; } | Called with the new value (X, Y) on press and on every drag frame. |
| Size { get; set; } | Side of the square pad in px; 0 → fill the width of its cell (the pad stays square). |
See Also
Section titled “See Also”- record HudElement
- namespace Stellar.Abstractions.Services