2
0

class_popup.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the Popup.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_Popup:
  6. Popup
  7. =====
  8. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Inherited By:** :ref:`PopupDialog<class_PopupDialog>`, :ref:`PopupMenu<class_PopupMenu>`, :ref:`PopupPanel<class_PopupPanel>`, :ref:`WindowDialog<class_WindowDialog>`
  10. **Category:** Core
  11. Brief Description
  12. -----------------
  13. Base container control for popups and dialogs.
  14. Properties
  15. ----------
  16. +-------------------------+--------------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`popup_exclusive<class_Popup_property_popup_exclusive>` |
  18. +-------------------------+--------------------------------------------------------------+
  19. Methods
  20. -------
  21. +------+--------------------------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`popup<class_Popup_method_popup>` **(** :ref:`Rect2<class_Rect2>` bounds=Rect2( 0, 0, 0, 0 ) **)** |
  23. +------+--------------------------------------------------------------------------------------------------------------------------------------------+
  24. | void | :ref:`popup_centered<class_Popup_method_popup_centered>` **(** :ref:`Vector2<class_Vector2>` size=Vector2( 0, 0 ) **)** |
  25. +------+--------------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`popup_centered_minsize<class_Popup_method_popup_centered_minsize>` **(** :ref:`Vector2<class_Vector2>` minsize=Vector2( 0, 0 ) **)** |
  27. +------+--------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`popup_centered_ratio<class_Popup_method_popup_centered_ratio>` **(** :ref:`float<class_float>` ratio=0.75 **)** |
  29. +------+--------------------------------------------------------------------------------------------------------------------------------------------+
  30. Signals
  31. -------
  32. .. _class_Popup_signal_about_to_show:
  33. - **about_to_show** **(** **)**
  34. 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).
  35. ----
  36. .. _class_Popup_signal_popup_hide:
  37. - **popup_hide** **(** **)**
  38. This signal is emitted when a popup is hidden.
  39. Constants
  40. ---------
  41. .. _class_Popup_constant_NOTIFICATION_POST_POPUP:
  42. .. _class_Popup_constant_NOTIFICATION_POPUP_HIDE:
  43. - **NOTIFICATION_POST_POPUP** = **80** --- Notification sent right after the popup is shown.
  44. - **NOTIFICATION_POPUP_HIDE** = **81** --- Notification sent right after the popup is hidden.
  45. Description
  46. -----------
  47. 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.
  48. Property Descriptions
  49. ---------------------
  50. .. _class_Popup_property_popup_exclusive:
  51. - :ref:`bool<class_bool>` **popup_exclusive**
  52. +----------+----------------------+
  53. | *Setter* | set_exclusive(value) |
  54. +----------+----------------------+
  55. | *Getter* | is_exclusive() |
  56. +----------+----------------------+
  57. 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.
  58. Method Descriptions
  59. -------------------
  60. .. _class_Popup_method_popup:
  61. - void **popup** **(** :ref:`Rect2<class_Rect2>` bounds=Rect2( 0, 0, 0, 0 ) **)**
  62. Popup (show the control in modal form).
  63. ----
  64. .. _class_Popup_method_popup_centered:
  65. - void **popup_centered** **(** :ref:`Vector2<class_Vector2>` size=Vector2( 0, 0 ) **)**
  66. 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".
  67. ----
  68. .. _class_Popup_method_popup_centered_minsize:
  69. - void **popup_centered_minsize** **(** :ref:`Vector2<class_Vector2>` minsize=Vector2( 0, 0 ) **)**
  70. 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``.
  71. ----
  72. .. _class_Popup_method_popup_centered_ratio:
  73. - void **popup_centered_ratio** **(** :ref:`float<class_float>` ratio=0.75 **)**
  74. 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.