class_popup.rst 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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:`PopupDialog<class_PopupDialog>`, :ref:`PopupMenu<class_PopupMenu>`, :ref:`PopupPanel<class_PopupPanel>`, :ref:`WindowDialog<class_WindowDialog>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Base container control for popups and dialogs.
  13. Properties
  14. ----------
  15. +-------------------------+-----------------------------------------------------+
  16. | :ref:`bool<class_bool>` | :ref:`popup_exclusive<class_Popup_popup_exclusive>` |
  17. +-------------------------+-----------------------------------------------------+
  18. Methods
  19. -------
  20. +-------+-------------------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`popup<class_Popup_popup>` **(** :ref:`Rect2<class_Rect2>` bounds=Rect2( 0, 0, 0, 0 ) **)** |
  22. +-------+-------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`popup_centered<class_Popup_popup_centered>` **(** :ref:`Vector2<class_Vector2>` size=Vector2( 0, 0 ) **)** |
  24. +-------+-------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`popup_centered_minsize<class_Popup_popup_centered_minsize>` **(** :ref:`Vector2<class_Vector2>` minsize=Vector2( 0, 0 ) **)** |
  26. +-------+-------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`popup_centered_ratio<class_Popup_popup_centered_ratio>` **(** :ref:`float<class_float>` ratio=0.75 **)** |
  28. +-------+-------------------------------------------------------------------------------------------------------------------------------------+
  29. Signals
  30. -------
  31. .. _class_Popup_about_to_show:
  32. - **about_to_show** **(** **)**
  33. 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).
  34. .. _class_Popup_popup_hide:
  35. - **popup_hide** **(** **)**
  36. This signal is emitted when a popup is hidden.
  37. 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. Property Descriptions
  45. ---------------------
  46. .. _class_Popup_popup_exclusive:
  47. - :ref:`bool<class_bool>` **popup_exclusive**
  48. +----------+----------------------+
  49. | *Setter* | set_exclusive(value) |
  50. +----------+----------------------+
  51. | *Getter* | is_exclusive() |
  52. +----------+----------------------+
  53. 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.
  54. Method Descriptions
  55. -------------------
  56. .. _class_Popup_popup:
  57. - void **popup** **(** :ref:`Rect2<class_Rect2>` bounds=Rect2( 0, 0, 0, 0 ) **)**
  58. Popup (show the control in modal form).
  59. .. _class_Popup_popup_centered:
  60. - void **popup_centered** **(** :ref:`Vector2<class_Vector2>` size=Vector2( 0, 0 ) **)**
  61. 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".
  62. .. _class_Popup_popup_centered_minsize:
  63. - void **popup_centered_minsize** **(** :ref:`Vector2<class_Vector2>` minsize=Vector2( 0, 0 ) **)**
  64. 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``.
  65. .. _class_Popup_popup_centered_ratio:
  66. - void **popup_centered_ratio** **(** :ref:`float<class_float>` ratio=0.75 **)**
  67. 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.