class_popup.rst 4.9 KB

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