class_margincontainer.rst 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. Simple margin container.
  10. Description
  11. -----------
  12. 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 ``MarginContainer``'s margin, use the ``margin_*`` theme properties listed below.
  13. **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 ``MarginContainer`` by code, you should use the following examples:
  14. ::
  15. var margin_value = 100
  16. set("custom_constants/margin_top", margin_value)
  17. set("custom_constants/margin_left", margin_value)
  18. set("custom_constants/margin_bottom", margin_value)
  19. set("custom_constants/margin_right", margin_value)
  20. Theme Properties
  21. ----------------
  22. +-----------------------+---------------+---+
  23. | :ref:`int<class_int>` | margin_bottom | 0 |
  24. +-----------------------+---------------+---+
  25. | :ref:`int<class_int>` | margin_left | 0 |
  26. +-----------------------+---------------+---+
  27. | :ref:`int<class_int>` | margin_right | 0 |
  28. +-----------------------+---------------+---+
  29. | :ref:`int<class_int>` | margin_top | 0 |
  30. +-----------------------+---------------+---+
  31. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  32. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  33. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`