Skip to content

Search

Documentation

widget_menu

The rows a menu reads: where its popup opens and what shuts it. The widget_menu component of the Balaur game engine: its 6 properties, and the functions…

On this page

ui · 6 properties · UI

The rows a menu reads: where its popup opens and what shuts it.

In a scene, widget_menu is the node key that applies it. A script reaches each property below as a field on node.widget_menu: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.widget_menu.get() and node.widget_menu.set(table).

Properties

property type default description
close_on enum click_outside What shuts a menu's popup besides a row: a click outside it, any click at all, or nothing but Escape One of click_outside, click, never.
placement enum below Where a menu opens: under its button, above it, to its right or to its left, each from the side's start (below starts at the button's left edge, right at its top) or at _center or _end; at the pointer; or centred on the screen One of below, below_center, below_end, above, above_center, above_end, right, right_center, right_end, left, left_center, left_end, pointer, center.
placement_fallbacks list [] The placements a menu's popup tries, in order, where its own does not fit the screen; empty tries egui's, and naming the placement alone keeps it where it is
popup_gap float -1 The space between a menu's button and its popup, in design pixels; below zero takes egui's
popup_width float 0 How wide a menu's popup starts, in design pixels; 0 sizes it to its rows At least 0.
showing bool false Holds a menu's rows up from the scene, as a click would; for an offscreen run or a tutorial, since nothing can click there