class_margincontainer.rst 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 MarginContainer.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_MarginContainer:
  6. MarginContainer
  7. ===============
  8. **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Simple margin container.
  13. Theme Properties
  14. ----------------
  15. +-----------------------+---------------+
  16. | :ref:`int<class_int>` | margin_bottom |
  17. +-----------------------+---------------+
  18. | :ref:`int<class_int>` | margin_left |
  19. +-----------------------+---------------+
  20. | :ref:`int<class_int>` | margin_right |
  21. +-----------------------+---------------+
  22. | :ref:`int<class_int>` | margin_top |
  23. +-----------------------+---------------+
  24. Description
  25. -----------
  26. Adds a top, left, bottom, and right margin to all :ref:`Control<class_Control>` nodes that are direct children of the container. To control the :ref:`MarginContainer<class_MarginContainer>`'s margin, use the ``margin_*`` theme properties listed below.
  27. **Note:** Be careful, :ref:`Control<class_Control>` margin values are different than the constant margin values. If you want to change the custom margin values of the :ref:`MarginContainer<class_MarginContainer>` by code you should use the following examples:
  28. ::
  29. var margin_value = 100
  30. set("custom_constants/margin_top", margin_value)
  31. set("custom_constants/margin_left", margin_value)
  32. set("custom_constants/margin_bottom", margin_value)
  33. set("custom_constants/margin_right", margin_value)