class_gridcontainer.rst 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/GridContainer.xml.
  6. .. _class_GridContainer:
  7. GridContainer
  8. =============
  9. **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A container that arranges its child controls in a grid layout.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **GridContainer** arranges its child controls in a grid layout. The number of columns is specified by the :ref:`columns<class_GridContainer_property_columns>` property, whereas the number of rows depends on how many are needed for the child controls. The number of rows and columns is preserved for every size of the container.
  15. \ **Note:** **GridContainer** only works with child nodes inheriting from :ref:`Control<class_Control>`. It won't rearrange child nodes inheriting from :ref:`Node2D<class_Node2D>`.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`Using Containers <../tutorials/ui/gui_containers>`
  20. - `Operating System Testing Demo <https://godotengine.org/asset-library/asset/2789>`__
  21. .. rst-class:: classref-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +-----------------------+------------------------------------------------------+-------+
  27. | :ref:`int<class_int>` | :ref:`columns<class_GridContainer_property_columns>` | ``1`` |
  28. +-----------------------+------------------------------------------------------+-------+
  29. .. rst-class:: classref-reftable-group
  30. Theme Properties
  31. ----------------
  32. .. table::
  33. :widths: auto
  34. +-----------------------+----------------------------------------------------------------------+-------+
  35. | :ref:`int<class_int>` | :ref:`h_separation<class_GridContainer_theme_constant_h_separation>` | ``4`` |
  36. +-----------------------+----------------------------------------------------------------------+-------+
  37. | :ref:`int<class_int>` | :ref:`v_separation<class_GridContainer_theme_constant_v_separation>` | ``4`` |
  38. +-----------------------+----------------------------------------------------------------------+-------+
  39. .. rst-class:: classref-section-separator
  40. ----
  41. .. rst-class:: classref-descriptions-group
  42. Property Descriptions
  43. ---------------------
  44. .. _class_GridContainer_property_columns:
  45. .. rst-class:: classref-property
  46. :ref:`int<class_int>` **columns** = ``1`` :ref:`🔗<class_GridContainer_property_columns>`
  47. .. rst-class:: classref-property-setget
  48. - |void| **set_columns**\ (\ value\: :ref:`int<class_int>`\ )
  49. - :ref:`int<class_int>` **get_columns**\ (\ )
  50. The number of columns in the **GridContainer**. If modified, **GridContainer** reorders its Control-derived children to accommodate the new layout.
  51. .. rst-class:: classref-section-separator
  52. ----
  53. .. rst-class:: classref-descriptions-group
  54. Theme Property Descriptions
  55. ---------------------------
  56. .. _class_GridContainer_theme_constant_h_separation:
  57. .. rst-class:: classref-themeproperty
  58. :ref:`int<class_int>` **h_separation** = ``4`` :ref:`🔗<class_GridContainer_theme_constant_h_separation>`
  59. The horizontal separation of child nodes.
  60. .. rst-class:: classref-item-separator
  61. ----
  62. .. _class_GridContainer_theme_constant_v_separation:
  63. .. rst-class:: classref-themeproperty
  64. :ref:`int<class_int>` **v_separation** = ``4`` :ref:`🔗<class_GridContainer_theme_constant_v_separation>`
  65. The vertical separation of child nodes.
  66. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  67. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  68. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  69. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  70. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  71. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  72. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  73. .. |void| replace:: :abbr:`void (No return value.)`