class_scrollcontainer.rst 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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 ScrollContainer.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ScrollContainer:
  6. ScrollContainer
  7. ===============
  8. **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Inherited By:** :ref:`EditorInspector<class_EditorInspector>`
  10. A helper node for displaying scrollable elements such as lists.
  11. Description
  12. -----------
  13. A ScrollContainer node meant to contain a :ref:`Control<class_Control>` child.
  14. ScrollContainers will automatically create a scrollbar child (:ref:`HScrollBar<class_HScrollBar>`, :ref:`VScrollBar<class_VScrollBar>`, or both) when needed and will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the :ref:`Control.rect_min_size<class_Control_property_rect_min_size>` of the Control relative to the ScrollContainer.
  15. Works great with a :ref:`Panel<class_Panel>` control. You can set ``EXPAND`` on the children's size flags, so they will upscale to the ScrollContainer's size if it's larger (scroll is invisible for the chosen dimension).
  16. Properties
  17. ----------
  18. +-------------------------+--------------------------------------------------------------------------------------------+-----------------+
  19. | :ref:`bool<class_bool>` | :ref:`follow_focus<class_ScrollContainer_property_follow_focus>` | ``false`` |
  20. +-------------------------+--------------------------------------------------------------------------------------------+-----------------+
  21. | :ref:`bool<class_bool>` | rect_clip_content | **O:** ``true`` |
  22. +-------------------------+--------------------------------------------------------------------------------------------+-----------------+
  23. | :ref:`int<class_int>` | :ref:`scroll_deadzone<class_ScrollContainer_property_scroll_deadzone>` | ``0`` |
  24. +-------------------------+--------------------------------------------------------------------------------------------+-----------------+
  25. | :ref:`int<class_int>` | :ref:`scroll_horizontal<class_ScrollContainer_property_scroll_horizontal>` | ``0`` |
  26. +-------------------------+--------------------------------------------------------------------------------------------+-----------------+
  27. | :ref:`bool<class_bool>` | :ref:`scroll_horizontal_enabled<class_ScrollContainer_property_scroll_horizontal_enabled>` | ``true`` |
  28. +-------------------------+--------------------------------------------------------------------------------------------+-----------------+
  29. | :ref:`int<class_int>` | :ref:`scroll_vertical<class_ScrollContainer_property_scroll_vertical>` | ``0`` |
  30. +-------------------------+--------------------------------------------------------------------------------------------+-----------------+
  31. | :ref:`bool<class_bool>` | :ref:`scroll_vertical_enabled<class_ScrollContainer_property_scroll_vertical_enabled>` | ``true`` |
  32. +-------------------------+--------------------------------------------------------------------------------------------+-----------------+
  33. Methods
  34. -------
  35. +-------------------------------------+----------------------------------------------------------------------------------+
  36. | :ref:`HScrollBar<class_HScrollBar>` | :ref:`get_h_scrollbar<class_ScrollContainer_method_get_h_scrollbar>` **(** **)** |
  37. +-------------------------------------+----------------------------------------------------------------------------------+
  38. | :ref:`VScrollBar<class_VScrollBar>` | :ref:`get_v_scrollbar<class_ScrollContainer_method_get_v_scrollbar>` **(** **)** |
  39. +-------------------------------------+----------------------------------------------------------------------------------+
  40. Theme Properties
  41. ----------------
  42. +---------------------------------+----+
  43. | :ref:`StyleBox<class_StyleBox>` | bg |
  44. +---------------------------------+----+
  45. Signals
  46. -------
  47. .. _class_ScrollContainer_signal_scroll_ended:
  48. - **scroll_ended** **(** **)**
  49. Emitted when scrolling stops.
  50. ----
  51. .. _class_ScrollContainer_signal_scroll_started:
  52. - **scroll_started** **(** **)**
  53. Emitted when scrolling is started.
  54. Property Descriptions
  55. ---------------------
  56. .. _class_ScrollContainer_property_follow_focus:
  57. - :ref:`bool<class_bool>` **follow_focus**
  58. +-----------+-------------------------+
  59. | *Default* | ``false`` |
  60. +-----------+-------------------------+
  61. | *Setter* | set_follow_focus(value) |
  62. +-----------+-------------------------+
  63. | *Getter* | is_following_focus() |
  64. +-----------+-------------------------+
  65. If ``true``, the ScrollContainer will automatically scroll to focused children (including indirect children) to make sure they are fully visible.
  66. ----
  67. .. _class_ScrollContainer_property_scroll_deadzone:
  68. - :ref:`int<class_int>` **scroll_deadzone**
  69. +-----------+---------------------+
  70. | *Default* | ``0`` |
  71. +-----------+---------------------+
  72. | *Setter* | set_deadzone(value) |
  73. +-----------+---------------------+
  74. | *Getter* | get_deadzone() |
  75. +-----------+---------------------+
  76. ----
  77. .. _class_ScrollContainer_property_scroll_horizontal:
  78. - :ref:`int<class_int>` **scroll_horizontal**
  79. +-----------+---------------------+
  80. | *Default* | ``0`` |
  81. +-----------+---------------------+
  82. | *Setter* | set_h_scroll(value) |
  83. +-----------+---------------------+
  84. | *Getter* | get_h_scroll() |
  85. +-----------+---------------------+
  86. The current horizontal scroll value.
  87. ----
  88. .. _class_ScrollContainer_property_scroll_horizontal_enabled:
  89. - :ref:`bool<class_bool>` **scroll_horizontal_enabled**
  90. +-----------+----------------------------+
  91. | *Default* | ``true`` |
  92. +-----------+----------------------------+
  93. | *Setter* | set_enable_h_scroll(value) |
  94. +-----------+----------------------------+
  95. | *Getter* | is_h_scroll_enabled() |
  96. +-----------+----------------------------+
  97. If ``true``, enables horizontal scrolling.
  98. ----
  99. .. _class_ScrollContainer_property_scroll_vertical:
  100. - :ref:`int<class_int>` **scroll_vertical**
  101. +-----------+---------------------+
  102. | *Default* | ``0`` |
  103. +-----------+---------------------+
  104. | *Setter* | set_v_scroll(value) |
  105. +-----------+---------------------+
  106. | *Getter* | get_v_scroll() |
  107. +-----------+---------------------+
  108. The current vertical scroll value.
  109. ----
  110. .. _class_ScrollContainer_property_scroll_vertical_enabled:
  111. - :ref:`bool<class_bool>` **scroll_vertical_enabled**
  112. +-----------+----------------------------+
  113. | *Default* | ``true`` |
  114. +-----------+----------------------------+
  115. | *Setter* | set_enable_v_scroll(value) |
  116. +-----------+----------------------------+
  117. | *Getter* | is_v_scroll_enabled() |
  118. +-----------+----------------------------+
  119. If ``true``, enables vertical scrolling.
  120. Method Descriptions
  121. -------------------
  122. .. _class_ScrollContainer_method_get_h_scrollbar:
  123. - :ref:`HScrollBar<class_HScrollBar>` **get_h_scrollbar** **(** **)**
  124. Returns the horizontal scrollbar :ref:`HScrollBar<class_HScrollBar>` of this ``ScrollContainer``.
  125. ----
  126. .. _class_ScrollContainer_method_get_v_scrollbar:
  127. - :ref:`VScrollBar<class_VScrollBar>` **get_v_scrollbar** **(** **)**
  128. Returns the vertical scrollbar :ref:`VScrollBar<class_VScrollBar>` of this ``ScrollContainer``.