class_popup.rst 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_Popup:
  4. Popup
  5. =====
  6. **Inherits:** :ref:`Control<class_control>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Inherited By:** :ref:`PopupPanel<class_popuppanel>`, :ref:`PopupDialog<class_popupdialog>`, :ref:`PopupMenu<class_popupmenu>`, :ref:`WindowDialog<class_windowdialog>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Base container control for popups and dialogs.
  12. Member Functions
  13. ----------------
  14. +--------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`bool<class_bool>` | :ref:`is_exclusive<class_Popup_is_exclusive>` **(** **)** const |
  16. +--------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`popup<class_Popup_popup>` **(** **)** |
  18. +--------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`popup_centered<class_Popup_popup_centered>` **(** :ref:`Vector2<class_vector2>` size=Vector2(0, 0) **)** |
  20. +--------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`popup_centered_minsize<class_Popup_popup_centered_minsize>` **(** :ref:`Vector2<class_vector2>` minsize=Vector2(0, 0) **)** |
  22. +--------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`popup_centered_ratio<class_Popup_popup_centered_ratio>` **(** :ref:`float<class_float>` ratio=0.75 **)** |
  24. +--------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`set_exclusive<class_Popup_set_exclusive>` **(** :ref:`bool<class_bool>` enable **)** |
  26. +--------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  27. Signals
  28. -------
  29. - **about_to_show** **(** **)**
  30. 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).
  31. - **popup_hide** **(** **)**
  32. This signal is emitted when a popup is hidden.
  33. Numeric Constants
  34. -----------------
  35. - **NOTIFICATION_POST_POPUP** = **80** --- Notification sent right after the popup is shown.
  36. - **NOTIFICATION_POPUP_HIDE** = **81** --- Notification sent right after the popup is hidden.
  37. Description
  38. -----------
  39. 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.
  40. Member Function Description
  41. ---------------------------
  42. .. _class_Popup_is_exclusive:
  43. - :ref:`bool<class_bool>` **is_exclusive** **(** **)** const
  44. Returns whether the popup will hide other popups when shown on the screen.
  45. .. _class_Popup_popup:
  46. - void **popup** **(** **)**
  47. Popup (show the control in modal form).
  48. .. _class_Popup_popup_centered:
  49. - void **popup_centered** **(** :ref:`Vector2<class_vector2>` size=Vector2(0, 0) **)**
  50. Popup (show the control in modal form) in the center of the screen, at the current size, or at a size determined by "size".
  51. .. _class_Popup_popup_centered_minsize:
  52. - void **popup_centered_minsize** **(** :ref:`Vector2<class_vector2>` minsize=Vector2(0, 0) **)**
  53. Popup (show the control in modal form) in the center of the screen, ensuring the size is never smaller than ``minsize``.
  54. .. _class_Popup_popup_centered_ratio:
  55. - void **popup_centered_ratio** **(** :ref:`float<class_float>` ratio=0.75 **)**
  56. Popup (show the control in modal form) in the center of the screen, scaled at a ratio of size of the screen.
  57. .. _class_Popup_set_exclusive:
  58. - void **set_exclusive** **(** :ref:`bool<class_bool>` enable **)**
  59. Make the popup hide other popups when shown on the screen.