Skip to content
Version 2.35.0
↓ Get the launcher

StackLayer record

One overlay of a LayerStackElement. Not an element on its own — only valid inside a stack. Every option is an init property, so more can be added later without breaking compiled plugins.

public record StackLayer
name description
StackLayer(…) One overlay of a LayerStackElement. Not an element on its own — only valid inside a stack. Every option is an init property, so more can be added later without breaking compiled plugins.
Background { get; set; } Optional fill painted over the whole overlay rect, behind Content (e.g. a translucent dim over the base). Polled at the window refresh rate and repainted only when it changes, so it can follow the theme live; the alpha is honoured. Null (default) = no fill.
BlocksInput { get; set; } True = while shown, the overlay swallows ALL pointer input over its rect (click, hover, wheel, drag), so nothing in the layers below reacts — the window can still be moved by its frame as usual. False (default) = purely decorative: the overlay and everything in it is click-through.
Center { get; set; } True = Content keeps its preferred size and is centred in the overlay (a spinner, a “Loading…” label). False (default) = the content is stretched to fill the overlay.
Content { get; set; } What the overlay shows. By default it is stretched to cover the whole stack rect.
OnEscape { get; set; } Called once when the player presses Esc while this overlay is shown (framework 2.35.0) — e.g. close the popover it draws. Only ONE overlay gets each press: the one in the frontmost shown window, and in that window the one drawn on top. A press goes elsewhere instead (this is not called) while a text field is focused (Esc leaves the field), while a dropdown or click-away pop-up is open (Esc closes that), or while a ConfirmHostElement confirm is open in that window or in a window in front of it (Esc cancels the confirm). The press is not hidden from the game, the same as a confirm’s Esc. Main thread. Null (default) = Esc does nothing for this overlay.
Rect { get; set; } Place the overlay in a sub-rect of the stack instead of covering all of it (framework 2.34.0), in px from the stack’s edges — e.g. a bar or a label over a slot of frame art. The rect follows the stack’s size (a window resize) with no per-refresh work. Input blocking and Background use the placed rect. Null (default) = cover the whole stack, unchanged.
Visible { get; set; } Shown while this returns true (polled at the window refresh rate; a change only toggles the overlay on or off). Null (default) = always shown.