TextureProgressBar
Linear or radial progress drawn from three texture layers.
TextureUnder draws the background, TextureProgress draws partially according to Ratio, and TextureOver draws on top. Layers are optional with separate Tint settings. Your code supplies Value; this class does not provide ProgressBar’s percentage label or Indeterminate mode. Step defaults to 1: configure it explicitly for smooth fractional progress.
For example, MinValue = 0, MaxValue = 200 and Value = 50 give Ratio = 0.25. Normally leave Page = 0. For an ordinary bar, choose FillModeEnum.LeftToRight or another linear direction; FillMode takes int, so cast the enum. LeftToRight/RightToLeft are explicit directions rather than automatic RTL Begin/End modes.
Without NinePatchStretch, layers use source texture sizes and intrinsic minimum is their componentwise maximum, at least 1 × 1. Increasing Size alone does not stretch a linear texture. NinePatchStretch enables border-aware stretching using StretchMargin and changes minimum size to opposite-border sums. Those sums remain even without textures. Use nonnegative borders that fit the source layers.
For radial progress, choose Clockwise, CounterClockwise or ClockwiseAndCounterClockwise. RadialInitialAngle specifies the start in degrees: 0 points upward. RadialFillDegrees sets maximum span 0…360; actual span is Ratio × RadialFillDegrees. For example, Ratio = 0.5 with span 180 produces a 90° sector. A ring shape comes from an image with transparency rather than radial mode itself. Radial fill is not sliced as a nine-patch; enabling NinePatchStretch scales it to Size.
RadialCenterOffset is a pixel offset from source texture center. The stored offset is unrestricted, but the effective calculated center is clamped to the texture rectangle. TextureProgressOffset shifts fill without increasing intrinsic minimum. In the current nine-patch path, layer identity is determined by resource equality: a background or overlay using the fill resource can receive the offset too. Use separate texture instances for independent offsets; this documents an implementation limitation rather than an engine fix.
Texture references are shared. Source-resource changes affect layers using it; Tint affects only the corresponding layer’s display. MouseFilter defaults to Pass — use Ignore for a decorative indicator over interactive elements.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
TextureProgressBarConstructor
public TextureProgressBar();Creates an indicator without textures: Value = 0, bounds 0…100, Step = 1, LeftToRight direction, NinePatchStretch = false, white tints. MouseFilter = Pass.
Properties16
FillModeProperty
public int FillMode { get; set; }Fill direction: linear, two symmetric Bilinear and three radial modes. Takes int from TextureProgressBar.FillModeEnum; default LeftToRight. Does not change Value. Bilinear here means two-sided filling rather than texture filtering.
NinePatchStretchProperty
public bool NinePatchStretch { get; set; }Default false: linear layers draw at source size. true stretches using StretchMargin and sets minimum size to border sums. With true, radial fill scales to Size without nine-patch slicing; background/overlay use the ordinary nine-patch path.
RadialCenterOffsetProperty
public Vector2 RadialCenterOffset { get; set; }Pixel offset from source TextureProgress center, default Vector2.Zero. Getter returns the stored offset; effective drawing center is clamped to the texture rectangle.
RadialFillDegreesProperty
public float RadialFillDegrees { get; set; }Maximum radial span in degrees, default 360. Clamped to 0…360 rather than wrapped; actual span is multiplied by Ratio. Supply a finite number.
RadialInitialAngleProperty
public float RadialInitialAngle { get; set; }Initial radial angle in degrees; default 0 points upward. Finite values outside 0…360 wrap modulo 360; exactly 360 is retained. NaN/infinity are rejected. Does not choose linear-mode direction.
StretchMarginBottomProperty
public int StretchMarginBottom { get; set; }Bottom border thickness in source pixels, default 0. Contributes to minimum-size sums with NinePatchStretch. Not content padding; validate border sums.
StretchMarginLeftProperty
public int StretchMarginLeft { get; set; }Left border thickness in source pixels, default 0. Contributes to minimum-size sums with NinePatchStretch. Not content padding; validate border sums.
StretchMarginRightProperty
public int StretchMarginRight { get; set; }Right border thickness in source pixels, default 0. Contributes to minimum-size sums with NinePatchStretch. Not content padding; validate border sums.
StretchMarginTopProperty
public int StretchMarginTop { get; set; }Top border thickness in source pixels, default 0. Contributes to minimum-size sums with NinePatchStretch. Not content padding; validate border sums.
TextureOverProperty
public Texture2D TextureOver { get; set; }Overlay shared Texture2D, or null. Resource is not copied; changes are observed. Without NinePatchStretch, layer size contributes to Control minimum.
TextureProgressProperty
public Texture2D TextureProgress { get; set; }Partially shown fill shared Texture2D, or null. Resource is not copied; changes are observed. Without NinePatchStretch, layer size contributes to Control minimum.
TextureProgressOffsetProperty
public Vector2 TextureProgressOffset { get; set; }Fill offset in local pixels, default Vector2.Zero. Does not increase minimum size. In the nine-patch path, a matching background/overlay resource can receive the same offset; use separate texture instances for independence.
TextureUnderProperty
public Texture2D TextureUnder { get; set; }Background shared Texture2D, or null. Resource is not copied; changes are observed. Without NinePatchStretch, layer size contributes to Control minimum.
TintOverProperty
public Color TintOver { get; set; }Color/alpha multiplier for the overlay layer, default white. Does not edit source texture pixels or set Value.
TintProgressProperty
public Color TintProgress { get; set; }Color/alpha multiplier for the fill layer, default white. Does not edit source texture pixels or set Value.
TintUnderProperty
public Color TintUnder { get; set; }Color/alpha multiplier for the background layer, default white. Does not edit source texture pixels or set Value.
Methods26
GetFillDegreesfloat
public float GetFillDegrees();Maximum radial span in degrees, default 360. Clamped to 0…360 rather than wrapped; actual span is multiplied by Ratio. Supply a finite number.
floatStored maximum span in degrees, clamped to 0…360.
GetFillModeint
public int GetFillMode();Fill direction: linear, two symmetric Bilinear and three radial modes. Takes int from TextureProgressBar.FillModeEnum; default LeftToRight. Does not change Value. Bilinear here means two-sided filling rather than texture filtering.
intNumeric value of the selected TextureProgressBar.FillModeEnum.
GetNinePatchStretchbool
public bool GetNinePatchStretch();Default false: linear layers draw at source size. true stretches using StretchMargin and sets minimum size to border sums. With true, radial fill scales to Size without nine-patch slicing; background/overlay use the ordinary nine-patch path.
booltrue when border-aware stretching is enabled.
GetOverTextureTexture2D
public Texture2D GetOverTexture();Overlay shared Texture2D, or null. Resource is not copied; changes are observed. Without NinePatchStretch, layer size contributes to Control minimum.
Texture2DCurrent shared Texture2D, or null.
GetProgressTextureTexture2D
public Texture2D GetProgressTexture();Partially shown fill shared Texture2D, or null. Resource is not copied; changes are observed. Without NinePatchStretch, layer size contributes to Control minimum.
Texture2DCurrent shared Texture2D, or null.
GetRadialCenterOffsetVector2
public Vector2 GetRadialCenterOffset();Pixel offset from source TextureProgress center, default Vector2.Zero. Getter returns the stored offset; effective drawing center is clamped to the texture rectangle.
Vector2Stored pixel offset from source texture center rather than the clamped effective center.
GetRadialInitialAnglefloat
public float GetRadialInitialAngle();Initial radial angle in degrees; default 0 points upward. Finite values outside 0…360 wrap modulo 360; exactly 360 is retained. NaN/infinity are rejected. Does not choose linear-mode direction.
floatStored initial angle in degrees after range normalization.
GetStretchMarginint
public int GetStretchMargin(Side margin);Returns stored selected-border thickness in pixels. Borders define minimum size with NinePatchStretch rather than child-content padding.
| Name | Type | Default |
|---|---|---|
margin | Side | — |
marginSelected Side.Left, Top, Right or Bottom.
intStored thickness of the selected border in source pixels.
GetTextureProgressOffsetVector2
public Vector2 GetTextureProgressOffset();Fill offset in local pixels, default Vector2.Zero. Does not increase minimum size. In the nine-patch path, a matching background/overlay resource can receive the same offset; use separate texture instances for independence.
Vector2Stored local fill offset in pixels.
GetTintOverColor
public Color GetTintOver();Color/alpha multiplier for the overlay layer, default white. Does not edit source texture pixels or set Value.
ColorOverlay-layer color and alpha multiplier.
GetTintProgressColor
public Color GetTintProgress();Color/alpha multiplier for the fill layer, default white. Does not edit source texture pixels or set Value.
ColorFill-layer color and alpha multiplier.
GetTintUnderColor
public Color GetTintUnder();Color/alpha multiplier for the background layer, default white. Does not edit source texture pixels or set Value.
ColorBackground-layer color and alpha multiplier.
GetUnderTextureTexture2D
public Texture2D GetUnderTexture();Background shared Texture2D, or null. Resource is not copied; changes are observed. Without NinePatchStretch, layer size contributes to Control minimum.
Texture2DCurrent shared Texture2D, or null.
SetFillDegreesvoid
public void SetFillDegrees(float mode);Maximum radial span in degrees, default 360. Clamped to 0…360 rather than wrapped; actual span is multiplied by Ratio. Supply a finite number.
| Name | Type | Default |
|---|---|---|
mode | float | — |
modeMaximum radial span in degrees, default 360. Clamped to 0…360 rather than wrapped; actual span is multiplied by Ratio. Supply a finite number.
SetFillModevoid
public void SetFillMode(int mode);Fill direction: linear, two symmetric Bilinear and three radial modes. Takes int from TextureProgressBar.FillModeEnum; default LeftToRight. Does not change Value. Bilinear here means two-sided filling rather than texture filtering.
| Name | Type | Default |
|---|---|---|
mode | int | — |
modeFill direction: linear, two symmetric Bilinear and three radial modes. Takes int from TextureProgressBar.FillModeEnum; default LeftToRight. Does not change Value. Bilinear here means two-sided filling rather than texture filtering.
SetNinePatchStretchvoid
public void SetNinePatchStretch(bool stretch);Default false: linear layers draw at source size. true stretches using StretchMargin and sets minimum size to border sums. With true, radial fill scales to Size without nine-patch slicing; background/overlay use the ordinary nine-patch path.
| Name | Type | Default |
|---|---|---|
stretch | bool | — |
stretchDefault false: linear layers draw at source size. true stretches using StretchMargin and sets minimum size to border sums. With true, radial fill scales to Size without nine-patch slicing; background/overlay use the ordinary nine-patch path.
SetOverTexturevoid
public void SetOverTexture(Texture2D tex);Overlay shared Texture2D, or null. Resource is not copied; changes are observed. Without NinePatchStretch, layer size contributes to Control minimum.
| Name | Type | Default |
|---|---|---|
tex | Texture2D | — |
texShared Texture2D, or null to clear the layer.
SetProgressTexturevoid
public void SetProgressTexture(Texture2D tex);Partially shown fill shared Texture2D, or null. Resource is not copied; changes are observed. Without NinePatchStretch, layer size contributes to Control minimum.
| Name | Type | Default |
|---|---|---|
tex | Texture2D | — |
texShared Texture2D, or null to clear the layer.
SetRadialCenterOffsetvoid
public void SetRadialCenterOffset(Vector2 mode);Pixel offset from source TextureProgress center, default Vector2.Zero. Getter returns the stored offset; effective drawing center is clamped to the texture rectangle.
| Name | Type | Default |
|---|---|---|
mode | Vector2 | — |
modePixel offset from source TextureProgress center, default Vector2.Zero. Getter returns the stored offset; effective drawing center is clamped to the texture rectangle.
SetRadialInitialAnglevoid
public void SetRadialInitialAngle(float mode);Initial radial angle in degrees; default 0 points upward. Finite values outside 0…360 wrap modulo 360; exactly 360 is retained. NaN/infinity are rejected. Does not choose linear-mode direction.
| Name | Type | Default |
|---|---|---|
mode | float | — |
modeInitial radial angle in degrees; default 0 points upward. Finite values outside 0…360 wrap modulo 360; exactly 360 is retained. NaN/infinity are rejected. Does not choose linear-mode direction.
SetStretchMarginvoid
public void SetStretchMargin(Side margin, int value);Sets border thickness in pixels. Side is validated; size is not automatically constrained. Use nonnegative values whose sums fit every source layer in use.
| Name | Type | Default |
|---|---|---|
margin | Side | — |
value | int | — |
marginSelected Side.Left, Top, Right or Bottom.
valueNonnegative border thickness in source pixels; validate the opposite-border sum.
SetTextureProgressOffsetvoid
public void SetTextureProgressOffset(Vector2 offset);Fill offset in local pixels, default Vector2.Zero. Does not increase minimum size. In the nine-patch path, a matching background/overlay resource can receive the same offset; use separate texture instances for independence.
| Name | Type | Default |
|---|---|---|
offset | Vector2 | — |
offsetFill offset in local pixels, default Vector2.Zero. Does not increase minimum size. In the nine-patch path, a matching background/overlay resource can receive the same offset; use separate texture instances for independence.
SetTintOvervoid
public void SetTintOver(Color tint);Color/alpha multiplier for the overlay layer, default white. Does not edit source texture pixels or set Value.
| Name | Type | Default |
|---|---|---|
tint | Color | — |
tintColor/alpha multiplier for the overlay layer, default white. Does not edit source texture pixels or set Value.
SetTintProgressvoid
public void SetTintProgress(Color tint);Color/alpha multiplier for the fill layer, default white. Does not edit source texture pixels or set Value.
| Name | Type | Default |
|---|---|---|
tint | Color | — |
tintColor/alpha multiplier for the fill layer, default white. Does not edit source texture pixels or set Value.
SetTintUndervoid
public void SetTintUnder(Color tint);Color/alpha multiplier for the background layer, default white. Does not edit source texture pixels or set Value.
| Name | Type | Default |
|---|---|---|
tint | Color | — |
tintColor/alpha multiplier for the background layer, default white. Does not edit source texture pixels or set Value.
SetUnderTexturevoid
public void SetUnderTexture(Texture2D tex);Background shared Texture2D, or null. Resource is not copied; changes are observed. Without NinePatchStretch, layer size contributes to Control minimum.
| Name | Type | Default |
|---|---|---|
tex | Texture2D | — |
texShared Texture2D, or null to clear the layer.