Files
godot-docs/classes/class_popup.rst
2019-05-28 18:41:24 +02:00

122 lines
5.9 KiB
ReStructuredText

.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the Popup.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.
.. _class_Popup:
Popup
=====
**Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`PopupDialog<class_PopupDialog>`, :ref:`PopupMenu<class_PopupMenu>`, :ref:`PopupPanel<class_PopupPanel>`, :ref:`WindowDialog<class_WindowDialog>`
**Category:** Core
Brief Description
-----------------
Base container control for popups and dialogs.
Properties
----------
+-------------------------+--------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`popup_exclusive<class_Popup_property_popup_exclusive>` |
+-------------------------+--------------------------------------------------------------+
Methods
-------
+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`popup<class_Popup_method_popup>` **(** :ref:`Rect2<class_Rect2>` bounds=Rect2( 0, 0, 0, 0 ) **)** |
+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`popup_centered<class_Popup_method_popup_centered>` **(** :ref:`Vector2<class_Vector2>` size=Vector2( 0, 0 ) **)** |
+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`popup_centered_clamped<class_Popup_method_popup_centered_clamped>` **(** :ref:`Vector2<class_Vector2>` size=Vector2( 0, 0 ), :ref:`float<class_float>` fallback_ratio=0.75 **)** |
+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`popup_centered_minsize<class_Popup_method_popup_centered_minsize>` **(** :ref:`Vector2<class_Vector2>` minsize=Vector2( 0, 0 ) **)** |
+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`popup_centered_ratio<class_Popup_method_popup_centered_ratio>` **(** :ref:`float<class_float>` ratio=0.75 **)** |
+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_Popup_signal_about_to_show:
- **about_to_show** **(** **)**
This signal is emitted when a popup is about to be shown. (often used in :ref:`PopupMenu<class_PopupMenu>` for clearing the list of options and creating a new one according to the current context).
.. _class_Popup_signal_popup_hide:
- **popup_hide** **(** **)**
This signal is emitted when a popup is hidden.
Constants
---------
.. _class_Popup_constant_NOTIFICATION_POST_POPUP:
.. _class_Popup_constant_NOTIFICATION_POPUP_HIDE:
- **NOTIFICATION_POST_POPUP** = **80** --- Notification sent right after the popup is shown.
- **NOTIFICATION_POPUP_HIDE** = **81** --- Notification sent right after the popup is hidden.
Description
-----------
Popup is a base :ref:`Control<class_Control>` used to show dialogs and popups. It's a subwindow and modal by default (see :ref:`Control<class_Control>`) and has helpers for custom popup behavior.
Property Descriptions
---------------------
.. _class_Popup_property_popup_exclusive:
- :ref:`bool<class_bool>` **popup_exclusive**
+----------+----------------------+
| *Setter* | set_exclusive(value) |
+----------+----------------------+
| *Getter* | is_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
-------------------
.. _class_Popup_method_popup:
- void **popup** **(** :ref:`Rect2<class_Rect2>` bounds=Rect2( 0, 0, 0, 0 ) **)**
Popup (show the control in modal form).
.. _class_Popup_method_popup_centered:
- void **popup_centered** **(** :ref:`Vector2<class_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".
.. _class_Popup_method_popup_centered_clamped:
- void **popup_centered_clamped** **(** :ref:`Vector2<class_Vector2>` size=Vector2( 0, 0 ), :ref:`float<class_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``.
.. _class_Popup_method_popup_centered_minsize:
- void **popup_centered_minsize** **(** :ref:`Vector2<class_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``.
.. _class_Popup_method_popup_centered_ratio:
- void **popup_centered_ratio** **(** :ref:`float<class_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.