mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
281 lines
11 KiB
ReStructuredText
281 lines
11 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_ProgressBar:
|
|
|
|
ProgressBar
|
|
===========
|
|
|
|
**繼承:** :ref:`Range<class_Range>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
將百分比視覺化表示的控制項。
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
說明
|
|
----
|
|
|
|
A control used for visual representation of a percentage. Shows the fill percentage in the center. Can also be used to show indeterminate progress. For more fill modes, use :ref:`TextureProgressBar<class_TextureProgressBar>` instead.
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
屬性
|
|
----
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-------------------------+----------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`editor_preview_indeterminate<class_ProgressBar_property_editor_preview_indeterminate>` | |
|
|
+-------------------------+----------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`int<class_int>` | :ref:`fill_mode<class_ProgressBar_property_fill_mode>` | ``0`` |
|
|
+-------------------------+----------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`indeterminate<class_ProgressBar_property_indeterminate>` | ``false`` |
|
|
+-------------------------+----------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`show_percentage<class_ProgressBar_property_show_percentage>` | ``true`` |
|
|
+-------------------------+----------------------------------------------------------------------------------------------+-----------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
主題屬性
|
|
--------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`font_color<class_ProgressBar_theme_color_font_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
|
|
+---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`font_outline_color<class_ProgressBar_theme_color_font_outline_color>` | ``Color(0, 0, 0, 1)`` |
|
|
+---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`outline_size<class_ProgressBar_theme_constant_outline_size>` | ``0`` |
|
|
+---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
|
|
| :ref:`Font<class_Font>` | :ref:`font<class_ProgressBar_theme_font_font>` | |
|
|
+---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`font_size<class_ProgressBar_theme_font_size_font_size>` | |
|
|
+---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
|
|
| :ref:`StyleBox<class_StyleBox>` | :ref:`background<class_ProgressBar_theme_style_background>` | |
|
|
+---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
|
|
| :ref:`StyleBox<class_StyleBox>` | :ref:`fill<class_ProgressBar_theme_style_fill>` | |
|
|
+---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
列舉
|
|
----
|
|
|
|
.. _enum_ProgressBar_FillMode:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **FillMode**: :ref:`🔗<enum_ProgressBar_FillMode>`
|
|
|
|
.. _class_ProgressBar_constant_FILL_BEGIN_TO_END:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`FillMode<enum_ProgressBar_FillMode>` **FILL_BEGIN_TO_END** = ``0``
|
|
|
|
進度條從開頭到結尾水平填充,開頭和結尾的位置取決於語言的方向。如果 :ref:`Control.is_layout_rtl()<class_Control_method_is_layout_rtl>` 返回 ``false`` 則為從左至右填充,如果返回 ``true`` 則為從右至左填充。
|
|
|
|
.. _class_ProgressBar_constant_FILL_END_TO_BEGIN:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`FillMode<enum_ProgressBar_FillMode>` **FILL_END_TO_BEGIN** = ``1``
|
|
|
|
進度條從結尾到開頭水平填充,開頭和結尾的位置取決於語言的方向。如果 :ref:`Control.is_layout_rtl()<class_Control_method_is_layout_rtl>` 返回 ``false`` 則為從左至右填充,如果返回 ``true`` 則為從右至左填充。
|
|
|
|
.. _class_ProgressBar_constant_FILL_TOP_TO_BOTTOM:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`FillMode<enum_ProgressBar_FillMode>` **FILL_TOP_TO_BOTTOM** = ``2``
|
|
|
|
進度從上到下填充。
|
|
|
|
.. _class_ProgressBar_constant_FILL_BOTTOM_TO_TOP:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`FillMode<enum_ProgressBar_FillMode>` **FILL_BOTTOM_TO_TOP** = ``3``
|
|
|
|
進度從下到上填充。
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
屬性說明
|
|
--------
|
|
|
|
.. _class_ProgressBar_property_editor_preview_indeterminate:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **editor_preview_indeterminate** :ref:`🔗<class_ProgressBar_property_editor_preview_indeterminate>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_editor_preview_indeterminate**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_editor_preview_indeterminate_enabled**\ (\ )
|
|
|
|
If ``false``, the :ref:`indeterminate<class_ProgressBar_property_indeterminate>` animation will be paused in the editor.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ProgressBar_property_fill_mode:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **fill_mode** = ``0`` :ref:`🔗<class_ProgressBar_property_fill_mode>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_fill_mode**\ (\ value\: :ref:`int<class_int>`\ )
|
|
- :ref:`int<class_int>` **get_fill_mode**\ (\ )
|
|
|
|
填充方向。可能的取值見 :ref:`FillMode<enum_ProgressBar_FillMode>`\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ProgressBar_property_indeterminate:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **indeterminate** = ``false`` :ref:`🔗<class_ProgressBar_property_indeterminate>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_indeterminate**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_indeterminate**\ (\ )
|
|
|
|
When set to ``true``, the progress bar indicates that something is happening with an animation, but does not show the fill percentage or value.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ProgressBar_property_show_percentage:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **show_percentage** = ``true`` :ref:`🔗<class_ProgressBar_property_show_percentage>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_show_percentage**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_percentage_shown**\ (\ )
|
|
|
|
為 ``true`` 時,將在進度條上顯示百分比。
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
主題屬性說明
|
|
------------
|
|
|
|
.. _class_ProgressBar_theme_color_font_color:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`Color<class_Color>` **font_color** = ``Color(0.95, 0.95, 0.95, 1)`` :ref:`🔗<class_ProgressBar_theme_color_font_color>`
|
|
|
|
文字的顏色。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ProgressBar_theme_color_font_outline_color:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`Color<class_Color>` **font_outline_color** = ``Color(0, 0, 0, 1)`` :ref:`🔗<class_ProgressBar_theme_color_font_outline_color>`
|
|
|
|
**ProgressBar** 的文字輪廓的色調。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ProgressBar_theme_constant_outline_size:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`int<class_int>` **outline_size** = ``0`` :ref:`🔗<class_ProgressBar_theme_constant_outline_size>`
|
|
|
|
文字輪廓的大小。
|
|
|
|
\ **注意:**\ 如果使用啟用了 :ref:`FontFile.multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` 的字形,其 :ref:`FontFile.msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` 必須至少設定為 :ref:`outline_size<class_ProgressBar_theme_constant_outline_size>` 的\ *兩倍*\ ,輪廓算繪才能看起來正確。否則,輪廓可能會比預期的更早被切斷。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ProgressBar_theme_font_font:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`Font<class_Font>` **font** :ref:`🔗<class_ProgressBar_theme_font_font>`
|
|
|
|
:ref:`show_percentage<class_ProgressBar_property_show_percentage>` 為 ``true`` 時,用於繪製填充百分比的字形。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ProgressBar_theme_font_size_font_size:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`int<class_int>` **font_size** :ref:`🔗<class_ProgressBar_theme_font_size_font_size>`
|
|
|
|
:ref:`show_percentage<class_ProgressBar_property_show_percentage>` 為 ``true`` 時,用於繪製填充百分比的字形。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ProgressBar_theme_style_background:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`StyleBox<class_StyleBox>` **background** :ref:`🔗<class_ProgressBar_theme_style_background>`
|
|
|
|
背景的樣式。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ProgressBar_theme_style_fill:
|
|
|
|
.. rst-class:: classref-themeproperty
|
|
|
|
:ref:`StyleBox<class_StyleBox>` **fill** :ref:`🔗<class_ProgressBar_theme_style_fill>`
|
|
|
|
進度的樣式(即填充進度條的部分)。
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)`
|
|
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
|
.. |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 (無回傳值。)`
|