mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-04 10:09:56 +03:00
139 lines
5.7 KiB
ReStructuredText
139 lines
5.7 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. meta::
|
|
:keywords: padding
|
|
|
|
.. DO NOT EDIT THIS FILE!!!
|
|
.. Generated automatically from Godot engine sources.
|
|
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
|
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/MarginContainer.xml.
|
|
|
|
.. _class_MarginContainer:
|
|
|
|
MarginContainer
|
|
===============
|
|
|
|
**Hereda:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
A container that keeps a margin around its child controls.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Descripción
|
|
----------------------
|
|
|
|
**MarginContainer** adds an adjustable margin on each side of its child controls. The margins are added around all children, not around each individual one. To control the **MarginContainer**'s margins, use the ``margin_*`` theme properties listed below.
|
|
|
|
\ **Note:** The margin sizes are theme overrides, not normal properties. This is an example of how to change them in code:
|
|
|
|
|
|
.. tabs::
|
|
|
|
.. code-tab:: gdscript
|
|
|
|
# This code sample assumes the current script is extending MarginContainer.
|
|
var margin_value = 100
|
|
add_theme_constant_override("margin_top", margin_value)
|
|
add_theme_constant_override("margin_left", margin_value)
|
|
add_theme_constant_override("margin_bottom", margin_value)
|
|
add_theme_constant_override("margin_right", margin_value)
|
|
|
|
.. code-tab:: csharp
|
|
|
|
// This code sample assumes the current script is extending MarginContainer.
|
|
int marginValue = 100;
|
|
AddThemeConstantOverride("margin_top", marginValue);
|
|
AddThemeConstantOverride("margin_left", marginValue);
|
|
AddThemeConstantOverride("margin_bottom", marginValue);
|
|
AddThemeConstantOverride("margin_right", marginValue);
|
|
|
|
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Tutoriales
|
|
--------------------
|
|
|
|
- :doc:`Usar Contenedores <../tutorials/ui/gui_containers>`
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Propiedades del Tema
|
|
----------------------------------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-----------------------+--------------------------------------------------------------------------+-------+
|
|
| :ref:`int<class_int>` | :ref:`margin_bottom<class_MarginContainer_theme_constant_margin_bottom>` | ``0`` |
|
|
+-----------------------+--------------------------------------------------------------------------+-------+
|
|
| :ref:`int<class_int>` | :ref:`margin_left<class_MarginContainer_theme_constant_margin_left>` | ``0`` |
|
|
+-----------------------+--------------------------------------------------------------------------+-------+
|
|
| :ref:`int<class_int>` | :ref:`margin_right<class_MarginContainer_theme_constant_margin_right>` | ``0`` |
|
|
+-----------------------+--------------------------------------------------------------------------+-------+
|
|
| :ref:`int<class_int>` | :ref:`margin_top<class_MarginContainer_theme_constant_margin_top>` | ``0`` |
|
|
+-----------------------+--------------------------------------------------------------------------+-------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Descripciones de las propiedades del tema
|
|
----------------------------------------------------------------------------------
|
|
|
|
.. _class_MarginContainer_theme_constant_margin_bottom:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`int<class_int>` **margin_bottom** = ``0`` :ref:`🔗<class_MarginContainer_theme_constant_margin_bottom>`
|
|
|
|
Offsets towards the inside direct children of the container by this amount of pixels from the bottom.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_MarginContainer_theme_constant_margin_left:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`int<class_int>` **margin_left** = ``0`` :ref:`🔗<class_MarginContainer_theme_constant_margin_left>`
|
|
|
|
Offsets towards the inside direct children of the container by this amount of pixels from the left.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_MarginContainer_theme_constant_margin_right:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`int<class_int>` **margin_right** = ``0`` :ref:`🔗<class_MarginContainer_theme_constant_margin_right>`
|
|
|
|
Offsets towards the inside direct children of the container by this amount of pixels from the right.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_MarginContainer_theme_constant_margin_top:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`int<class_int>` **margin_top** = ``0`` :ref:`🔗<class_MarginContainer_theme_constant_margin_top>`
|
|
|
|
Offsets towards the inside direct children of the container by this amount of pixels from the top.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (Normalmente, este método debería ser sobreescrito por el usuario para que tenga algún efecto.)`
|
|
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
|
.. |const| replace:: :abbr:`const (Este método no tiene efectos secundarios. No modifica ninguna de las variables miembro de la instancia.)`
|
|
.. |vararg| replace:: :abbr:`vararg (Este método permite agregar cualquier número de argumentos después de los descritos aquí.)`
|
|
.. |constructor| replace:: :abbr:`constructor (Este método se utiliza para construir un tipo.)`
|
|
.. |static| replace:: :abbr:`static (Este método no necesita una instancia para ser llamado, por lo que puede llamarse directamente utilizando el nombre de la clase.)`
|
|
.. |operator| replace:: :abbr:`operator (Este método describe un operador válido para usar con este tipo como operando izquierdo.)`
|
|
.. |bitfield| replace:: :abbr:`BitField (Este valor es un entero compuesto como una máscara de bits de las siguientes banderas.)`
|
|
.. |void| replace:: :abbr:`void (Sin valor de retorno.)`
|