TextureProgressBar
Texture-based progress bar. Useful for loading screens and life or stamina bars.
TextureProgressBar.swift:11class TextureProgressBar
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.
Superclasses
class Range
Abstract base class for controls that represent a number within a range.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Types
Type members
Instance members
var fillMode: Int32
The fill direction. See
FillMode
for possible values.var ninePatchStretch: Bool
If
true
, Godot treats the bar’s textures like inNinePatchRect
. Use thestretch_margin_*
properties likestretchMarginBottom
to set up the nine patch’s 3×3 grid. When using a radialfillMode
, this setting will enable stretching.var radialCenterOffset: Vector2
Offsets
textureProgress
iffillMode
is .fillClockwise or .fillCounterClockwise.var radialFillDegrees: Double
Upper limit for the fill of
textureProgress
iffillMode
is .fillClockwise or .fillCounterClockwise. When the node’svalue
is equal to itsmax_value
, the texture fills up to this angle.var radialInitialAngle: Double
Starting angle for the fill of
textureProgress
iffillMode
is .fillClockwise or .fillCounterClockwise. When the node’svalue
is equal to itsmin_value
, the texture doesn’t show up at all. When thevalue
increases, the texture fills and tends towardsradialFillDegrees
.var stretchMarginBottom: Int32
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.
var stretchMarginLeft: Int32
The width of the 9-patch’s left column.
var stretchMarginRight: Int32
The width of the 9-patch’s right column.
var stretchMarginTop: Int32
The height of the 9-patch’s top row.
var textureOver: Texture2D?
Texture2D
that draws over the progress bar. Use it to add highlights or an upper-frame that hides part oftextureProgress
.var textureProgress: Texture2D?
Texture2D
that clips based on the node’svalue
andfillMode
. Asvalue
increased, the texture fills up. It shows entirely whenvalue
reachesmax_value
. It doesn’t show at all ifvalue
is equal tomin_value
.var textureProgressOffset: Vector2
The offset of
textureProgress
. Useful fortextureOver
andtextureUnder
with fancy borders, to avoid transparent margins in your progress texture.var textureUnder: Texture2D?
Texture2D
that draws under the progress bar. The bar’s background.var tintOver: Color
Multiplies the color of the bar’s
textureOver
texture. The effect is similar tomodulate
, except it only affects this specific texture instead of the entire node.var tintProgress: Color
Multiplies the color of the bar’s
textureProgress
texture.var tintUnder: Color
Multiplies the color of the bar’s
textureUnder
texture.