Files
godot-docs-l10n/classes/zh_CN/class_labelsettings.rst

218 lines
8.0 KiB
ReStructuredText

:github_url: hide
.. 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/LabelSettings.xml.
.. _class_LabelSettings:
LabelSettings
=============
**继承:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
提供能够在 :ref:`Label<class_Label>` 中自定义文本的常见设置。
.. rst-class:: classref-introduction-group
描述
----
**LabelSettings** 是一种提供在 :ref:`Label<class_Label>` 中自定义文本的常见设置的资源。优先于 :ref:`Control.theme<class_Control_property_theme>` 中定义的属性。该资源可以在多个标签之间共享,可以随时替换,因此可以方便、灵活地设置文本样式。
.. rst-class:: classref-reftable-group
属性
----
.. table::
:widths: auto
+-------------------------------+------------------------------------------------------------------+-----------------------+
| :ref:`Font<class_Font>` | :ref:`font<class_LabelSettings_property_font>` | |
+-------------------------------+------------------------------------------------------------------+-----------------------+
| :ref:`Color<class_Color>` | :ref:`font_color<class_LabelSettings_property_font_color>` | ``Color(1, 1, 1, 1)`` |
+-------------------------------+------------------------------------------------------------------+-----------------------+
| :ref:`int<class_int>` | :ref:`font_size<class_LabelSettings_property_font_size>` | ``16`` |
+-------------------------------+------------------------------------------------------------------+-----------------------+
| :ref:`float<class_float>` | :ref:`line_spacing<class_LabelSettings_property_line_spacing>` | ``3.0`` |
+-------------------------------+------------------------------------------------------------------+-----------------------+
| :ref:`Color<class_Color>` | :ref:`outline_color<class_LabelSettings_property_outline_color>` | ``Color(1, 1, 1, 1)`` |
+-------------------------------+------------------------------------------------------------------+-----------------------+
| :ref:`int<class_int>` | :ref:`outline_size<class_LabelSettings_property_outline_size>` | ``0`` |
+-------------------------------+------------------------------------------------------------------+-----------------------+
| :ref:`Color<class_Color>` | :ref:`shadow_color<class_LabelSettings_property_shadow_color>` | ``Color(0, 0, 0, 0)`` |
+-------------------------------+------------------------------------------------------------------+-----------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`shadow_offset<class_LabelSettings_property_shadow_offset>` | ``Vector2(1, 1)`` |
+-------------------------------+------------------------------------------------------------------+-----------------------+
| :ref:`int<class_int>` | :ref:`shadow_size<class_LabelSettings_property_shadow_size>` | ``1`` |
+-------------------------------+------------------------------------------------------------------+-----------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
属性说明
--------
.. _class_LabelSettings_property_font:
.. rst-class:: classref-property
:ref:`Font<class_Font>` **font** :ref:`🔗<class_LabelSettings_property_font>`
.. rst-class:: classref-property-setget
- |void| **set_font**\ (\ value\: :ref:`Font<class_Font>`\ )
- :ref:`Font<class_Font>` **get_font**\ (\ )
文本使用的 :ref:`Font<class_Font>`\ 。
.. rst-class:: classref-item-separator
----
.. _class_LabelSettings_property_font_color:
.. rst-class:: classref-property
:ref:`Color<class_Color>` **font_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_LabelSettings_property_font_color>`
.. rst-class:: classref-property-setget
- |void| **set_font_color**\ (\ value\: :ref:`Color<class_Color>`\ )
- :ref:`Color<class_Color>` **get_font_color**\ (\ )
文本的颜色。
.. rst-class:: classref-item-separator
----
.. _class_LabelSettings_property_font_size:
.. rst-class:: classref-property
:ref:`int<class_int>` **font_size** = ``16`` :ref:`🔗<class_LabelSettings_property_font_size>`
.. rst-class:: classref-property-setget
- |void| **set_font_size**\ (\ value\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_font_size**\ (\ )
文本的大小。
.. rst-class:: classref-item-separator
----
.. _class_LabelSettings_property_line_spacing:
.. rst-class:: classref-property
:ref:`float<class_float>` **line_spacing** = ``3.0`` :ref:`🔗<class_LabelSettings_property_line_spacing>`
.. rst-class:: classref-property-setget
- |void| **set_line_spacing**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_line_spacing**\ (\ )
文本为多行时,行与行之间的垂直间距。
.. rst-class:: classref-item-separator
----
.. _class_LabelSettings_property_outline_color:
.. rst-class:: classref-property
:ref:`Color<class_Color>` **outline_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_LabelSettings_property_outline_color>`
.. rst-class:: classref-property-setget
- |void| **set_outline_color**\ (\ value\: :ref:`Color<class_Color>`\ )
- :ref:`Color<class_Color>` **get_outline_color**\ (\ )
轮廓的颜色。
.. rst-class:: classref-item-separator
----
.. _class_LabelSettings_property_outline_size:
.. rst-class:: classref-property
:ref:`int<class_int>` **outline_size** = ``0`` :ref:`🔗<class_LabelSettings_property_outline_size>`
.. rst-class:: classref-property-setget
- |void| **set_outline_size**\ (\ value\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_outline_size**\ (\ )
文本轮廓大小。
.. rst-class:: classref-item-separator
----
.. _class_LabelSettings_property_shadow_color:
.. rst-class:: classref-property
:ref:`Color<class_Color>` **shadow_color** = ``Color(0, 0, 0, 0)`` :ref:`🔗<class_LabelSettings_property_shadow_color>`
.. rst-class:: classref-property-setget
- |void| **set_shadow_color**\ (\ value\: :ref:`Color<class_Color>`\ )
- :ref:`Color<class_Color>` **get_shadow_color**\ (\ )
阴影效果的颜色。如果 Alpha 为 ``0`` ,则不会绘制阴影。
.. rst-class:: classref-item-separator
----
.. _class_LabelSettings_property_shadow_offset:
.. rst-class:: classref-property
:ref:`Vector2<class_Vector2>` **shadow_offset** = ``Vector2(1, 1)`` :ref:`🔗<class_LabelSettings_property_shadow_offset>`
.. rst-class:: classref-property-setget
- |void| **set_shadow_offset**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
- :ref:`Vector2<class_Vector2>` **get_shadow_offset**\ (\ )
阴影效果的偏移,单位为像素。
.. rst-class:: classref-item-separator
----
.. _class_LabelSettings_property_shadow_size:
.. rst-class:: classref-property
:ref:`int<class_int>` **shadow_size** = ``1`` :ref:`🔗<class_LabelSettings_property_shadow_size>`
.. rst-class:: classref-property-setget
- |void| **set_shadow_size**\ (\ value\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_shadow_size**\ (\ )
阴影效果的大小。
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
.. |static| replace:: :abbr:`static (调用本方法无需实例,可直接使用类名进行调用。)`
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效运算符。)`
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列位标志构成位掩码的整数。)`
.. |void| replace:: :abbr:`void (无返回值。)`