Documentation
¶
Overview ¶
TextureProgressBar works like ProgressBar, but uses up to 3 textures instead of Godot's Theme resource. It can be used to create horizontal, vertical and radial progress bars.
Index ¶
- type Advanced
- type Any
- type Extension
- func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
- func (self *Extension[T]) AsControl() Control.Instance
- func (self *Extension[T]) AsNode() Node.Instance
- func (self *Extension[T]) AsObject() [1]gd.Object
- func (self *Extension[T]) AsRange() Range.Instance
- func (self *Extension[T]) AsTextureProgressBar() Instance
- type FillMode
- type ID
- type Instance
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsControl() Control.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRange() Range.Instance
- func (self Instance) AsTextureProgressBar() Instance
- func (self Instance) FillMode() int
- func (self Instance) ID() ID
- func (self Instance) NinePatchStretch() bool
- func (self Instance) RadialCenterOffset() Vector2.XY
- func (self Instance) RadialFillDegrees() Float.X
- func (self Instance) RadialInitialAngle() Angle.Radians
- func (self Instance) SetFillMode(value int)
- func (self Instance) SetNinePatchStretch(value bool)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetRadialCenterOffset(value Vector2.XY)
- func (self Instance) SetRadialFillDegrees(value Float.X)
- func (self Instance) SetRadialInitialAngle(value Angle.Radians)
- func (self Instance) SetStretchMarginBottom(value int)
- func (self Instance) SetStretchMarginLeft(value int)
- func (self Instance) SetStretchMarginRight(value int)
- func (self Instance) SetStretchMarginTop(value int)
- func (self Instance) SetTextureOver(value Texture2D.Instance)
- func (self Instance) SetTextureProgress(value Texture2D.Instance)
- func (self Instance) SetTextureProgressOffset(value Vector2.XY)
- func (self Instance) SetTextureUnder(value Texture2D.Instance)
- func (self Instance) SetTintOver(value Color.RGBA)
- func (self Instance) SetTintProgress(value Color.RGBA)
- func (self Instance) SetTintUnder(value Color.RGBA)
- func (self Instance) StretchMarginBottom() int
- func (self Instance) StretchMarginLeft() int
- func (self Instance) StretchMarginRight() int
- func (self Instance) StretchMarginTop() int
- func (self Instance) TextureOver() Texture2D.Instance
- func (self Instance) TextureProgress() Texture2D.Instance
- func (self Instance) TextureProgressOffset() Vector2.XY
- func (self Instance) TextureUnder() Texture2D.Instance
- func (self Instance) TintOver() Color.RGBA
- func (self Instance) TintProgress() Color.RGBA
- func (self Instance) TintUnder() Color.RGBA
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsCanvasItem ¶
func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
func (*Extension[T]) AsTextureProgressBar ¶
type FillMode ¶
type FillMode int //gd:TextureProgressBar.FillMode
const ( // The [TextureProgress] fills from left to right. // // [TextureProgress]: https://pkg.go.dev/graphics.gd/classdb/#Instance.TextureProgress FillLeftToRight FillMode = 0 // The [TextureProgress] fills from right to left. // // [TextureProgress]: https://pkg.go.dev/graphics.gd/classdb/#Instance.TextureProgress FillRightToLeft FillMode = 1 // The [TextureProgress] fills from top to bottom. // // [TextureProgress]: https://pkg.go.dev/graphics.gd/classdb/#Instance.TextureProgress FillTopToBottom FillMode = 2 // The [TextureProgress] fills from bottom to top. // // [TextureProgress]: https://pkg.go.dev/graphics.gd/classdb/#Instance.TextureProgress FillBottomToTop FillMode = 3 // Turns the node into a radial bar. The [TextureProgress] fills clockwise. See [RadialCenterOffset], [RadialInitialAngle] and [RadialFillDegrees] to control the way the bar fills up. // // [RadialCenterOffset]: https://pkg.go.dev/graphics.gd/classdb/#Instance.RadialCenterOffset // [RadialFillDegrees]: https://pkg.go.dev/graphics.gd/classdb/#Instance.RadialFillDegrees // [RadialInitialAngle]: https://pkg.go.dev/graphics.gd/classdb/#Instance.RadialInitialAngle // [TextureProgress]: https://pkg.go.dev/graphics.gd/classdb/#Instance.TextureProgress FillClockwise FillMode = 4 // Turns the node into a radial bar. The [TextureProgress] fills counterclockwise. See [RadialCenterOffset], [RadialInitialAngle] and [RadialFillDegrees] to control the way the bar fills up. // // [RadialCenterOffset]: https://pkg.go.dev/graphics.gd/classdb/#Instance.RadialCenterOffset // [RadialFillDegrees]: https://pkg.go.dev/graphics.gd/classdb/#Instance.RadialFillDegrees // [RadialInitialAngle]: https://pkg.go.dev/graphics.gd/classdb/#Instance.RadialInitialAngle // [TextureProgress]: https://pkg.go.dev/graphics.gd/classdb/#Instance.TextureProgress FillCounterClockwise FillMode = 5 // The [TextureProgress] fills from the center, expanding both towards the left and the right. // // [TextureProgress]: https://pkg.go.dev/graphics.gd/classdb/#Instance.TextureProgress FillBilinearLeftAndRight FillMode = 6 // The [TextureProgress] fills from the center, expanding both towards the top and the bottom. // // [TextureProgress]: https://pkg.go.dev/graphics.gd/classdb/#Instance.TextureProgress FillBilinearTopAndBottom FillMode = 7 // Turns the node into a radial bar. The [TextureProgress] fills radially from the center, expanding both clockwise and counterclockwise. See [RadialCenterOffset], [RadialInitialAngle] and [RadialFillDegrees] to control the way the bar fills up. // // [RadialCenterOffset]: https://pkg.go.dev/graphics.gd/classdb/#Instance.RadialCenterOffset // [RadialFillDegrees]: https://pkg.go.dev/graphics.gd/classdb/#Instance.RadialFillDegrees // [RadialInitialAngle]: https://pkg.go.dev/graphics.gd/classdb/#Instance.RadialInitialAngle // [TextureProgress]: https://pkg.go.dev/graphics.gd/classdb/#Instance.TextureProgress FillClockwiseAndCounterClockwise FillMode = 8 )
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.TextureProgressBar
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) AsTextureProgressBar ¶
func (Instance) NinePatchStretch ¶
If true, Godot treats the bar's textures like in NinePatchRect. Use the stretch_margin_* properties like StretchMarginBottom to set up the nine patch's 3×3 grid. When using a radial FillMode, this setting will only enable stretching for TextureProgress, while TextureUnder and TextureOver will be treated like in NinePatchRect.
func (Instance) RadialCenterOffset ¶
Offsets TextureProgress if FillMode is FillClockwise, FillCounterClockwise, or FillClockwiseAndCounterClockwise.
Note: The effective radial center always stays within the TextureProgress bounds. If you need to move it outside the texture's bounds, modify the TextureProgress to contain additional empty space where needed.
func (Instance) RadialFillDegrees ¶
Upper limit for the fill of TextureProgress if FillMode is FillClockwise, FillCounterClockwise, or FillClockwiseAndCounterClockwise. When the node's value is equal to its max_value, the texture fills up to this angle.
See Range.Value, Range.MaxValue.
func (Instance) RadialInitialAngle ¶
Starting angle for the fill of TextureProgress if FillMode is FillClockwise, FillCounterClockwise, or FillClockwiseAndCounterClockwise. 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.
Note: RadialInitialAngle is wrapped between 0 and 360 degrees (inclusive).
func (Instance) SetFillMode ¶
SetFillMode sets the property returned by [GetFillMode].
func (Instance) SetNinePatchStretch ¶
SetNinePatchStretch sets the property returned by [GetNinePatchStretch].
func (Instance) SetRadialCenterOffset ¶
SetRadialCenterOffset sets the property returned by [GetRadialCenterOffset].
func (Instance) SetRadialFillDegrees ¶
SetRadialFillDegrees sets the property returned by [GetFillDegrees].
func (Instance) SetRadialInitialAngle ¶
SetRadialInitialAngle sets the property returned by [GetRadialInitialAngle].
func (Instance) SetStretchMarginBottom ¶
SetStretchMarginBottom sets the property returned by [GetStretchMargin].
func (Instance) SetStretchMarginLeft ¶
SetStretchMarginLeft sets the property returned by [GetStretchMargin].
func (Instance) SetStretchMarginRight ¶
SetStretchMarginRight sets the property returned by [GetStretchMargin].
func (Instance) SetStretchMarginTop ¶
SetStretchMarginTop sets the property returned by [GetStretchMargin].
func (Instance) SetTextureOver ¶
SetTextureOver sets the property returned by [GetOverTexture].
func (Instance) SetTextureProgress ¶
SetTextureProgress sets the property returned by [GetProgressTexture].
func (Instance) SetTextureProgressOffset ¶
SetTextureProgressOffset sets the property returned by [GetTextureProgressOffset].
func (Instance) SetTextureUnder ¶
SetTextureUnder sets the property returned by [GetUnderTexture].
func (Instance) SetTintOver ¶
SetTintOver sets the property returned by [GetTintOver].
func (Instance) SetTintProgress ¶
SetTintProgress sets the property returned by [GetTintProgress].
func (Instance) SetTintUnder ¶
SetTintUnder sets the property returned by [GetTintUnder].
func (Instance) StretchMarginBottom ¶
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. Only effective if NinePatchStretch is true.
func (Instance) StretchMarginLeft ¶
The width of the 9-patch's left column. Only effective if NinePatchStretch is true.
func (Instance) StretchMarginRight ¶
The width of the 9-patch's right column. Only effective if NinePatchStretch is true.
func (Instance) StretchMarginTop ¶
The height of the 9-patch's top row. Only effective if NinePatchStretch is true.
func (Instance) TextureOver ¶
Texture2D that draws over the progress bar. Use it to add highlights or an upper-frame that hides part of TextureProgress.
func (Instance) TextureProgress ¶
Texture2D 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.
func (Instance) TextureProgressOffset ¶
The offset of TextureProgress. Useful for TextureOver and TextureUnder with fancy borders, to avoid transparent margins in your progress texture.
func (Instance) TextureUnder ¶
Texture2D that draws under the progress bar. The bar's background.
func (Instance) TintOver ¶
Multiplies the color of the bar's TextureOver texture. The effect is similar to CanvasItem.Modulate, except it only affects this specific texture instead of the entire node.
func (Instance) TintProgress ¶
Multiplies the color of the bar's TextureProgress texture.
func (Instance) TintUnder ¶
Multiplies the color of the bar's TextureUnder texture.