Welcome to the Godot Reference Fork and the Godot Proposals Fork alternatives. Why?

Popup

0 0 vote
Article Rating

Inherits: Control < CanvasItem < Node < Object

Inherited By: PopupDialog, PopupMenu, PopupPanel, WindowDialog

Base container control for popups and dialogs.

Description

Popup is a base 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

boolpopup_exclusivefalse
boolvisiblefalse (parent override)

Methods

voidPopup ( Rect2 bounds=Rect2( 0, 0, 0, 0 ) )
voidpopup_centered ( Vector2 size=Vector2( 0, 0 ) )
voidpopup_centered_clamped ( Vector2 size=Vector2( 0, 0 ), float fallback_ratio=0.75 )
voidpopup_centered_minsize ( Vector2 minsize=Vector2( 0, 0 ) )
voidpopup_centered_ratio ( float ratio=0.75 )
voidset_as_minsize ( )

Signals

  • about_to_show ( )

Emitted when a popup is about to be shown. This is often used in 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
Defaultfalse
Setterset_exclusive(value)
Getteris_exclusive()

If true, the popup will not be hidden when a click event occurs outside of it, or when it receives the ui_cancel action event.

Method Descriptions

  • void popup ( Rect2 bounds=Rect2( 0, 0, 0, 0 ) )

Popup (show the control in modal form).


  • void popup_centered ( Vector2 size=Vector2( 0, 0 ) )

Popup (show the control in modal form) in the center of the screen relative to its current canvas transform, at the current size, or at a size determined by size.


  • void popup_centered_clamped ( Vector2 size=Vector2( 0, 0 ), float fallback_ratio=0.75 )

Popup (show the control in modal form) in the center of the screen relative to the current canvas transform, clamping the size to size, then ensuring the popup is no larger than the viewport size multiplied by fallback_ratio.


  • void popup_centered_minsize ( Vector2 minsize=Vector2( 0, 0 ) )

Popup (show the control in modal form) in the center of the screen relative to the current canvas transform, ensuring the size is never smaller than minsize.


  • void 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.


  • void set_as_minsize ( )

Shrink popup to keep to the minimum size of content.

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x