TextureProgressBar

Hereda: Range < Control < CanvasItem < Node < Object

Barra de progreso basada en la textura. Útil para cargar pantallas y barras de vida o resistencia.

Descripción

TextureProgressBar funciona como ProgressBar, pero utiliza hasta 3 texturas en lugar del recurso Theme de Godot. Se puede utilizar para crear barras de progreso horizontales, verticales y radiales.

Propiedades

int

fill_mode

0

MouseFilter

mouse_filter

1 (overrides Control)

bool

nine_patch_stretch

false

Vector2

radial_center_offset

Vector2(0, 0)

float

radial_fill_degrees

360.0

float

radial_initial_angle

0.0

BitField[SizeFlags]

size_flags_vertical

1 (overrides Control)

float

step

1.0 (overrides Range)

int

stretch_margin_bottom

0

int

stretch_margin_left

0

int

stretch_margin_right

0

int

stretch_margin_top

0

Texture2D

texture_over

Texture2D

texture_progress

Vector2

texture_progress_offset

Vector2(0, 0)

Texture2D

texture_under

Color

tint_over

Color(1, 1, 1, 1)

Color

tint_progress

Color(1, 1, 1, 1)

Color

tint_under

Color(1, 1, 1, 1)

Métodos

int

get_stretch_margin(margin: Side) const

void

set_stretch_margin(margin: Side, value: int)


Enumeraciones

enum FillMode: 🔗

FillMode FILL_LEFT_TO_RIGHT = 0

El texture_progress se llena de izquierda a derecha.

FillMode FILL_RIGHT_TO_LEFT = 1

El texture_progress se llena de derecha a izquierda.

FillMode FILL_TOP_TO_BOTTOM = 2

El texture_progress se llena de arriba a abajo.

FillMode FILL_BOTTOM_TO_TOP = 3

El texture_progress se llena de abajo a arriba.

FillMode FILL_CLOCKWISE = 4

Convierte el nodo en una barra radial. El texture_progress se llena en el sentido de las agujas del reloj. Véase radial_center_offset, radial_initial_angle y radial_fill_degrees para controlar la forma en que la barra se llena.

FillMode FILL_COUNTER_CLOCKWISE = 5

Convierte el nodo en una barra radial. El texture_progress se llena en sentido contrario a las agujas del reloj. Véase radial_center_offset, radial_initial_angle y radial_fill_degrees para controlar la forma en que la barra se llena.

FillMode FILL_BILINEAR_LEFT_AND_RIGHT = 6

El texture_progress se llena desde el centro, expandiéndose tanto hacia la izquierda como hacia la derecha.

FillMode FILL_BILINEAR_TOP_AND_BOTTOM = 7

El texture_progress se llena desde el centro, expandiéndose tanto hacia arriba como hacia abajo.

FillMode FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE = 8

Convierte el nodo en una barra radial. El texture_progress se llena radialmente desde el centro, expandiéndose tanto en sentido horario como antihorario. Véase radial_center_offset, radial_initial_angle y radial_fill_degrees para controlar la forma en que la barra se llena.


Descripciones de Propiedades

int fill_mode = 0 🔗

  • void set_fill_mode(value: int)

  • int get_fill_mode()

La dirección de llenado. Véase FillMode para los posibles valores.


bool nine_patch_stretch = false 🔗

  • void set_nine_patch_stretch(value: bool)

  • bool get_nine_patch_stretch()

Si es true, Godot trata las texturas de la barra como en NinePatchRect. Usa las propiedades stretch_margin_* como stretch_margin_bottom para configurar la cuadrícula de 3×3 del nine patch. Cuando se utiliza un fill_mode radial, este ajuste solo habilitará el estiramiento para texture_progress, mientras que texture_under y texture_over se tratarán como en NinePatchRect.


Vector2 radial_center_offset = Vector2(0, 0) 🔗

  • void set_radial_center_offset(value: Vector2)

  • Vector2 get_radial_center_offset()

Desplaza texture_progress si fill_mode es FILL_CLOCKWISE, FILL_COUNTER_CLOCKWISE o FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE.

Nota: El centro radial efectivo siempre permanece dentro de los límites de texture_progress. Si necesitas moverlo fuera de los límites de la textura, modifica texture_progress para que contenga espacio vacío adicional donde sea necesario.


float radial_fill_degrees = 360.0 🔗

  • void set_fill_degrees(value: float)

  • float get_fill_degrees()

Límite superior para el relleno de texture_progress si fill_mode es FILL_CLOCKWISE, FILL_COUNTER_CLOCKWISE o FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE. Cuando el value del nodo es igual a su max_value, la textura se rellena hasta este ángulo.

Véase Range.value, Range.max_value.


float radial_initial_angle = 0.0 🔗

  • void set_radial_initial_angle(value: float)

  • float get_radial_initial_angle()

Ángulo inicial para el relleno de texture_progress si fill_mode es FILL_CLOCKWISE, FILL_COUNTER_CLOCKWISE o FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE. Cuando el value del nodo es igual a su min_value, la textura no se muestra en absoluto. Cuando el value aumenta, la textura se llena y tiende hacia radial_fill_degrees.

Nota: radial_initial_angle se ajusta entre 0 y 360 grados (inclusive).


int stretch_margin_bottom = 0 🔗

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

  • int get_stretch_margin(margin: Side) const

La altura de la fila inferior del 9-patch. Un margen de 16 significa que las esquinas y el lado inferior del 9-patch tendrán una altura de 16 píxeles. Puede establecer los 4 valores de margen individualmente para crear paneles con bordes no uniformes. Solo es efectivo si nine_patch_stretch es true.


int stretch_margin_left = 0 🔗

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

  • int get_stretch_margin(margin: Side) const

El ancho de la columna izquierda del 9-patch. Solo es efectivo si nine_patch_stretch es true.


int stretch_margin_right = 0 🔗

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

  • int get_stretch_margin(margin: Side) const

El ancho de la columna derecha del 9-patch. Solo es efectivo si nine_patch_stretch es true.


int stretch_margin_top = 0 🔗

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

  • int get_stretch_margin(margin: Side) const

La altura de la fila superior del 9-patch. Solo es efectivo si nine_patch_stretch es true.


Texture2D texture_over 🔗

Texture2D que dibuja sobre la barra de progreso. Úsala para añadir resaltados o un marco superior que oculte parte de texture_progress.


Texture2D texture_progress 🔗

Texture2D que se recorta según el value del nodo y fill_mode. A medida que aumenta value, la textura se rellena. Se muestra por completo cuando value alcanza max_value. No se muestra en absoluto si value es igual a min_value.

La propiedad value proviene de Range. Véase Range.value, Range.min_value, Range.max_value.


Vector2 texture_progress_offset = Vector2(0, 0) 🔗

  • void set_texture_progress_offset(value: Vector2)

  • Vector2 get_texture_progress_offset()

El desplazamiento de texture_progress. Útil para texture_over y texture_under con bordes sofisticados, para evitar márgenes transparentes en tu textura de progreso.


Texture2D texture_under 🔗

Texture2D que se dibuja debajo de la barra de progreso. El fondo de la barra.


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

  • void set_tint_over(value: Color)

  • Color get_tint_over()

Multiplica el color de la textura texture_over de la barra. El efecto es similar a CanvasItem.modulate, excepto que solo afecta a esta textura específica en lugar de a todo el nodo.


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

  • void set_tint_progress(value: Color)

  • Color get_tint_progress()

Multiplica el color de la textura texture_progress de la barra.


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

  • void set_tint_under(value: Color)

  • Color get_tint_under()

Multiplica el color de la textura texture_under de la barra.


Descripciones de Métodos

int get_stretch_margin(margin: Side) const 🔗

Devuelve el margen de estiramiento con el índice especificado. Véase stretch_margin_bottom y propiedades relacionadas.


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

Establece el margen de estiramiento con el índice especificado. Véase stretch_margin_bottom y propiedades relacionadas.