Jazz2::UI::Windows::OverlayOptions struct

How an element shown over the interface behaves.

An element that closes by a click outside of it and isn't modal is a popup — a menu, a list dropped down, a picker. The rest are windows, which stay until they're closed, see Surface::ClosePopups().

Public functions

auto IsPopup() const -> bool
Returns true if it's a popup, not a window.

Public variables

Vector2f Position
Position of the top left corner, it's moved to fit the screen.
bool Centered
Whether it's centered on the screen instead.
bool Modal
Whether nothing else can be used while it's shown.
bool CloseOnOutsideClick
Whether a click outside of it closes it, which makes it a popup unless it's modal.
bool HidesVirtualCursor
Whether the virtual cursor is hidden while it's shown, it's driven by the stick directly.
Element* Owner
Element shown over the interface it's shown from, it's closed with it, as a submenu with its menu.
float FallbackRight
Right edge it's put at instead if it doesn't fit right of its position, as a submenu goes left of its menu then, not used if negative.
bool Detachable
Whether it can be shown in a window of its own outside of the main window, see Surface::IsDetached().
Function<void()> OnClosed
Called when it's closed.

Variable documentation

bool Jazz2::UI::Windows::OverlayOptions::Detachable

Whether it can be shown in a window of its own outside of the main window, see Surface::IsDetached().

A window dragged out of the main window gets a window of the system, a popup gets one if it doesn't fit the main window or would be covered by a window shown that way. A modal element never does, it stays in the main window.