class_scrollcontainer.rst 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_ScrollContainer:
  4. ScrollContainer
  5. ===============
  6. **Inherits:** :ref:`Container<class_container>` **<** :ref:`Control<class_control>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. A helper node for displaying scrollable elements (e.g. lists).
  11. Member Functions
  12. ----------------
  13. +--------------------------+--------------------------------------------------------------------------------------------------------------------+
  14. | :ref:`int<class_int>` | :ref:`get_h_scroll<class_ScrollContainer_get_h_scroll>` **(** **)** const |
  15. +--------------------------+--------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`int<class_int>` | :ref:`get_v_scroll<class_ScrollContainer_get_v_scroll>` **(** **)** const |
  17. +--------------------------+--------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`bool<class_bool>` | :ref:`is_h_scroll_enabled<class_ScrollContainer_is_h_scroll_enabled>` **(** **)** const |
  19. +--------------------------+--------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`bool<class_bool>` | :ref:`is_v_scroll_enabled<class_ScrollContainer_is_v_scroll_enabled>` **(** **)** const |
  21. +--------------------------+--------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`set_enable_h_scroll<class_ScrollContainer_set_enable_h_scroll>` **(** :ref:`bool<class_bool>` enable **)** |
  23. +--------------------------+--------------------------------------------------------------------------------------------------------------------+
  24. | void | :ref:`set_enable_v_scroll<class_ScrollContainer_set_enable_v_scroll>` **(** :ref:`bool<class_bool>` enable **)** |
  25. +--------------------------+--------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`set_h_scroll<class_ScrollContainer_set_h_scroll>` **(** :ref:`int<class_int>` val **)** |
  27. +--------------------------+--------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`set_v_scroll<class_ScrollContainer_set_v_scroll>` **(** :ref:`int<class_int>` val **)** |
  29. +--------------------------+--------------------------------------------------------------------------------------------------------------------+
  30. Description
  31. -----------
  32. A ScrollContainer node with a :ref:`Control<class_control>` child and scrollbar child (HScrollbar, :ref:`VScrollBar<class_vscrollbar>`, or both) 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 minimum_size of the Control relative to the ScrollContainer. Works great with a :ref:`Panel<class_panel>` control. You can set EXPAND on children size flags, so they will upscale to ScrollContainer size if ScrollContainer size is bigger (scroll is invisible for chosen dimension).
  33. Member Function Description
  34. ---------------------------
  35. .. _class_ScrollContainer_get_h_scroll:
  36. - :ref:`int<class_int>` **get_h_scroll** **(** **)** const
  37. Return current horizontal scroll value.
  38. .. _class_ScrollContainer_get_v_scroll:
  39. - :ref:`int<class_int>` **get_v_scroll** **(** **)** const
  40. Return current vertical scroll value.
  41. .. _class_ScrollContainer_is_h_scroll_enabled:
  42. - :ref:`bool<class_bool>` **is_h_scroll_enabled** **(** **)** const
  43. Return true if horizontal scroll is allowed.
  44. .. _class_ScrollContainer_is_v_scroll_enabled:
  45. - :ref:`bool<class_bool>` **is_v_scroll_enabled** **(** **)** const
  46. Return true if vertical scroll is allowed.
  47. .. _class_ScrollContainer_set_enable_h_scroll:
  48. - void **set_enable_h_scroll** **(** :ref:`bool<class_bool>` enable **)**
  49. Set allows horizontal scroll.
  50. .. _class_ScrollContainer_set_enable_v_scroll:
  51. - void **set_enable_v_scroll** **(** :ref:`bool<class_bool>` enable **)**
  52. Set allows vertical scroll.
  53. .. _class_ScrollContainer_set_h_scroll:
  54. - void **set_h_scroll** **(** :ref:`int<class_int>` val **)**
  55. Set horizontal scroll value.
  56. .. _class_ScrollContainer_set_v_scroll:
  57. - void **set_v_scroll** **(** :ref:`int<class_int>` val **)**
  58. Set vertical scroll value.