Popup
Inherits: Control < CanvasItem < Node < Object Inherited By: PopupDialog, PopupMenu, PopupPanel, WindowDialog Base container control for popups and dialogs.
Description
Control used to show dialogs and popups. It’s a subwindow and modal by default (see Control) and has helpers for custom popup behavior. All popup methods ensure correct placement within the viewport.
Properties
Methods
Signals
- about_to_show ( ) PopupMenu to clear the list of options then create a new one according to the current context.
- popup_hide ( )
Emitted when a popup is hidden.
Constants
- NOTIFICATION_POST_POPUP = 80 —- Notification sent right after the popup is shown.
- NOTIFICATION_POPUP_HIDE = 81 —- Notification sent right after the popup is hidden.
Property Descriptions
- bool popup_exclusive
true, the popup will not be hidden when a click event occurs outside of it, or when it receives theui_cancelaction event. Note: Enabling this property doesn’t affect the Close or Cancel buttons’ behavior in dialogs that inherit from this class. As a workaround, you can use WindowDialog.get_close_button or ConfirmationDialog.get_cancel and hide the buttons in question by setting their CanvasItem.visible property tofalse.Method Descriptions
- popup ( Rect2 bounds=Rect2( 0, 0, 0, 0 ) ) Popup (show the control in modal form).
- popup_centered ( Vector2 size=Vector2( 0, 0 ) )
size.
- popup_centered_clamped ( Vector2 size=Vector2( 0, 0 ), float fallback_ratio=0.75 )
size, then ensuring the popup is no larger than the viewport size multiplied byfallback_ratio.
- popup_centered_minsize ( Vector2 minsize=Vector2( 0, 0 ) )
minsize.
- popup_centered_ratio ( float ratio=0.75 ) Popup (show the control in modal form) in the center of the screen relative to the current canvas transform, scaled at a ratio of size of the screen.
- set_as_minsize ( ) Shrink popup to keep to the minimum size of content.
