Texture-based progress bar. Useful for loading screens and life or stamina bars.
    public class TextureProgress : Range

TextureProgress works like ProgressBar but it uses up to 3 textures instead of Godot’s Theme resource. Works horizontally, vertically, and radially.

Inheritance Chain

Constructors

    public TextureProgress()

Properties

    public int FillMode { get; set; }

The fill direction. Uses FILL_* constants.

    public bool NinePatchStretch { get; set; }

If true Godot treats the bar’s textures like NinePatchRect. Use stretch_margin_*, like StretchMarginBottom, to set up the nine patch’s 3x3 grid. Default value: false.

    public Vector2 RadialCenterOffset { get; set; }

Offsets TextureProgress_ if FillMode is FILL_CLOCKWISE or FILL_COUNTER_CLOCKWISE.

    public float RadialFillDegrees { get; set; }

Upper limit for the fill of TextureProgress_ if FillMode is FILL_CLOCKWISE or FILL_COUNTER_CLOCKWISE. When the node’s value is equal to its max_value, the texture fills up to this angle.

See Range.Value, Range.MaxValue.

    public float RadialInitialAngle { get; set; }

Starting angle for the fill of TextureProgress_ if FillMode is FILL_CLOCKWISE or FILL_COUNTER_CLOCKWISE. When the node’s value is equal to its min_value, the texture doesn’t show up at all. When the value increases, the texture fills and tends towards RadialFillDegrees.

    public int StretchMarginBottom { get; set; }

The height of the 9-patch’s bottom row. A margin of 16 means the 9-slice’s bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders.

    public int StretchMarginLeft { get; set; }

The width of the 9-patch’s left column.

    public int StretchMarginRight { get; set; }

The width of the 9-patch’s right column.

    public int StretchMarginTop { get; set; }

The height of the 9-patch’s top row.

    public Texture TextureOver { get; set; }

Texture that draws over the progress bar. Use it to add highlights or an upper-frame that hides part of TextureProgress_.

    public Texture TextureProgress_ { get; set; }

Texture that clips based on the node’s value and FillMode. As value increased, the texture fills up. It shows entirely when value reaches max_value. It doesn’t show at all if value is equal to min_value.

The value property comes from Range. See Range.Value, Range.MinValue, Range.MaxValue.

    public Texture TextureUnder { get; set; }

Texture that draws under the progress bar. The bar’s background.

Methods

    public float GetFillDegrees()

Getter for RadialFillDegrees

    public int GetFillMode()

Getter for FillMode

    public bool GetNinePatchStretch()

Getter for NinePatchStretch

    public Texture GetOverTexture()

Getter for TextureOver

    public Texture GetProgressTexture()

Getter for TextureProgress_

    public Vector2 GetRadialCenterOffset()

Getter for RadialCenterOffset

    public float GetRadialInitialAngle()

Getter for RadialInitialAngle

    public int GetStretchMargin(Margin margin)

    public Texture GetUnderTexture()

Getter for TextureUnder

    public void SetFillDegrees(float mode)

Setter for RadialFillDegrees

    public void SetFillMode(int mode)

Setter for FillMode

    public void SetNinePatchStretch(bool stretch)

Setter for NinePatchStretch

    public void SetOverTexture(Texture tex)

Setter for TextureOver

    public void SetProgressTexture(Texture tex)

Setter for TextureProgress_

    public void SetRadialCenterOffset(Vector2 mode)

Setter for RadialCenterOffset

    public void SetRadialInitialAngle(float mode)

Setter for RadialInitialAngle

    public void SetStretchMargin(Margin margin, int value)

    public void SetUnderTexture(Texture tex)

Setter for TextureUnder

Inner Types

FillModeEnum

Name Value Description
LeftToRight 0 The [member texture_progress] fills from left to right.
RightToLeft 1 The [member texture_progress] fills from right to left.
TopToBottom 2 The [member texture_progress] fills from top to bototm.
BottomToTop 3 The [member texture_progress] fills from bottom to top.
Clockwise 4 Turns the node into a radial bar. The [member texture_progress] fills clockwise. See [member radial_center_offset], [member radial_initial_angle] and [member radial_fill_degrees] to refine its behavior.
CounterClockwise 5 Turns the node into a radial bar. The [member texture_progress] fills counter-clockwise. See [member radial_center_offset], [member radial_initial_angle] and [member radial_fill_degrees] to refine its behavior.
Tags: