class_popup.rst 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. | void | :ref:`popup<class_Popup_popup>` **(** :ref:`Rect2<class_rect2>` bounds=Rect2( 0, 0, 0, 0 ) **)** |
  17. +-------+-------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`popup_centered<class_Popup_popup_centered>` **(** :ref:`Vector2<class_vector2>` size=Vector2( 0, 0 ) **)** |
  19. +-------+-------------------------------------------------------------------------------------------------------------------------------------+
  20. | void | :ref:`popup_centered_minsize<class_Popup_popup_centered_minsize>` **(** :ref:`Vector2<class_vector2>` minsize=Vector2( 0, 0 ) **)** |
  21. +-------+-------------------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`popup_centered_ratio<class_Popup_popup_centered_ratio>` **(** :ref:`float<class_float>` ratio=0.75 **)** |
  23. +-------+-------------------------------------------------------------------------------------------------------------------------------------+
  24. Signals
  25. -------
  26. .. _class_Popup_about_to_show:
  27. - **about_to_show** **(** **)**
  28. 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).
  29. .. _class_Popup_popup_hide:
  30. - **popup_hide** **(** **)**
  31. This signal is emitted when a popup is hidden.
  32. Member Variables
  33. ----------------
  34. .. _class_Popup_popup_exclusive:
  35. - :ref:`bool<class_bool>` **popup_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.
  36. Numeric Constants
  37. -----------------
  38. - **NOTIFICATION_POST_POPUP** = **80** --- Notification sent right after the popup is shown.
  39. - **NOTIFICATION_POPUP_HIDE** = **81** --- Notification sent right after the popup is hidden.
  40. Description
  41. -----------
  42. 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.
  43. Member Function Description
  44. ---------------------------
  45. .. _class_Popup_popup:
  46. - void **popup** **(** :ref:`Rect2<class_rect2>` bounds=Rect2( 0, 0, 0, 0 ) **)**
  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.