TextureProgressBar

继承: Range < Control < Item < Object

基于纹理的进度条。用于加载屏幕和生活或耐力条。

描述

TextureProgressBar的工作方式类似于ProgressBar,但最多使用3个纹理而不是i3D的Theme资源。它可用于创建水平、垂直和径向进度条。

属性

方法

int

get_stretch_margin(margin: Side) const

void

set_stretch_margin(margin: Side, value: int)


枚举

enum FillMode: 🔗

FillMode FILL_LEFT_TO_RIGHT = 0

texture_progress从左到右填充。

FillMode FILL_RIGHT_TO_LEFT = 1

texture_progress从右向左填充。

FillMode FILL_TOP_TO_BOTTOM = 2

texture_progress从上到下填充。

FillMode FILL_BOTTOM_TO_TOP = 3

texture_progress从下往上填充。

FillMode FILL_CLOCKWISE = 4

将节点变成径向条。texture_progress顺时针填充。请参阅radial_center_offsetradial_initial_angleradial_fill_degrees来控制条填充的方式。

FillMode FILL_COUNTER_CLOCKWISE = 5

将节点变成径向条。texture_progress逆时针填充。请参阅radial_center_offsetradial_initial_angleradial_fill_degrees来控制条填充的方式。

FillMode FILL_BILINEAR_LEFT_AND_RIGHT = 6

texture_progress从中心填充,向左和向右扩展。

FillMode FILL_BILINEAR_TOP_AND_BOTTOM = 7

texture_progress从中心填充,向顶部和底部扩展。

FillMode FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE = 8

将节点变成径向条。texture_progress从中心沿径向填充,顺时针和逆时针都展开。请参阅radial_center_offsetradial_initial_angleradial_fill_degrees来控制条的填充方式。


属性说明

int fill_mode = 0 🔗

  • void set_fill_mode(value: int)

  • int get_fill_mode()

填充方向。有关可能的值,请参阅FillMode


bool nine_patch_stretch = false 🔗

  • void set_nine_patch_stretch(value: bool)

  • bool get_nine_patch_stretch()

如果true,i3D会使用stretch_margin_*属性,如stretch_margin_bottom,设置九个补丁的3×3网格。当使用径向fill_mode时,此设置将仅启用texture_progress的拉伸。


Vector2 radial_center_offset = Vector2(0, 0) 🔗

  • void set_radial_center_offset(value: Vector2)

  • Vector2 get_radial_center_offset()

如果fill_modeFILL_CLOCKWISEFILL_COUNTER_CLOCKWISEFILL_CLOCKWISE_AND_COUNTER_CLOCKWISE,则偏移texture_progress

注意:有效径向中心始终保持在texture_progress边界内。如果您需要将其移到纹理边界之外,请修改texture_progress以在需要的地方包含额外的空白空间。


float radial_fill_degrees = 360.0 🔗

  • void set_fill_degrees(value: float)

  • float get_fill_degrees()

texture_progress的填充上限,如果fill_modeFILL_CLOCKWISEFILL_COUNTER_CLOCKWISEFILL_CLOCKWISE_AND_COUNTER_CLOCKWISE。当节点的等于它的max_value时,纹理填充到这个角度。

请参见Range.valueRange.max_value


float radial_initial_angle = 0.0 🔗

  • void set_radial_initial_angle(value: float)

  • float get_radial_initial_angle()

texture_progress填充的起始角度,如果fill_modeFILL_CLOCKWISEFILL_COUNTER_CLOCKWISEFILL_CLOCKWISE_AND_COUNTER_CLOCKWISE。当节点的等于它的min_value时,纹理根本不显示。当增加时,纹理填充并倾向于radial_fill_degrees

注:radial_initial_angle包裹在0360度(含)之间。


int stretch_margin_bottom = 0 🔗

  • void set_stretch_margin(margin: Side, value: int)

  • int get_stretch_margin(margin: Side) const

9片底部行的高度。边距为16意味着9片的底部角落和侧面的高度为16像素。您可以单独设置所有4个边距值以创建具有非统一边框的面板。仅当nine_patch_stretchtrue时有效。


int stretch_margin_left = 0 🔗

  • void set_stretch_margin(margin: Side, value: int)

  • int get_stretch_margin(margin: Side) const

9补丁左栏的宽度。仅当nine_patch_stretchtrue时有效。


int stretch_margin_right = 0 🔗

  • void set_stretch_margin(margin: Side, value: int)

  • int get_stretch_margin(margin: Side) const

9补丁右列的宽度。仅当nine_patch_stretchtrue时有效。


int stretch_margin_top = 0 🔗

  • void set_stretch_margin(margin: Side, value: int)

  • int get_stretch_margin(margin: Side) const

9个补丁顶部行的高度。仅当nine_patch_stretchtrue时有效。


Texture2D texture_over 🔗

Texture2D绘制进度条。使用它来添加高光或隐藏texture_progress部分的上框。


Texture2D texture_progress 🔗

Texture2D基于节点的fill_mode进行剪辑。随着的增加,纹理填充。它完全显示何时达到max_value。它根本不显示是否等于min_value

value属性来自Range。请参阅Range.valueRange.min_valueRange.max_value


Vector2 texture_progress_offset = Vector2(0, 0) 🔗

  • void set_texture_progress_offset(value: Vector2)

  • Vector2 get_texture_progress_offset()

texture_progress的偏移量。对于带有花哨边框的texture_overtexture_under很有用,以避免进度纹理中的透明边距。


Texture2D texture_under 🔗

在进度条下绘制的Texture2D。进度条的背景。


Color tint_over = Color(1, 1, 1, 1) 🔗

  • void set_tint_over(value: Color)

  • Color get_tint_over()

将条形图的texture_over纹理的颜色相乘。


Color tint_progress = Color(1, 1, 1, 1) 🔗

  • void set_tint_progress(value: Color)

  • Color get_tint_progress()

将条形图texture_progress纹理的颜色相乘。


Color tint_under = Color(1, 1, 1, 1) 🔗

  • void set_tint_under(value: Color)

  • Color get_tint_under()

将条的texture_under纹理的颜色相乘。


方法说明

int get_stretch_margin(margin: Side) const 🔗

返回具有指定索引的拉伸边距。请参阅stretch_margin_bottom和相关属性。


void set_stretch_margin(margin: Side, value: int) 🔗

使用指定的索引设置拉伸边距。请参阅stretch_margin_bottom和相关属性。