StyleBoxTexture
A texture-based nine-patch StyleBox
.
class StyleBoxTexture
A texture-based nine-patch StyleBox
, in a way similar to NinePatchRect
. This stylebox performs a 3×3 scaling of a texture, where only the center cell is fully stretched. This makes it possible to design bordered styles regardless of the stylebox’s size.
Superclasses
class StyleBox
Abstract base class for defining stylized boxes for UI elements.
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 axisStretchHorizontal: StyleBoxTexture.AxisStretchMode
Controls how the stylebox’s texture will be stretched or tiled horizontally. See
AxisStretchMode
for possible values.var axisStretchVertical: StyleBoxTexture.AxisStretchMode
Controls how the stylebox’s texture will be stretched or tiled vertically. See
AxisStretchMode
for possible values.var drawCenter: Bool
If
true
, the nine-patch texture’s center tile will be drawn.var expandMarginBottom: Double
Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested.
var expandMarginLeft: Double
Expands the left margin of this style box when drawing, causing it to be drawn larger than requested.
var expandMarginRight: Double
Expands the right margin of this style box when drawing, causing it to be drawn larger than requested.
var expandMarginTop: Double
Expands the top margin of this style box when drawing, causing it to be drawn larger than requested.
var modulateColor: Color
Modulates the color of the texture when this style box is drawn.
var regionRect: Rect2
Species a sub-region of the texture to use.
var texture: Texture2D?
The texture to use when drawing this style box.
var textureMarginBottom: Double
Increases the bottom margin of the 3×3 texture box.
var textureMarginLeft: Double
Increases the left margin of the 3×3 texture box.
var textureMarginRight: Double
Increases the right margin of the 3×3 texture box.
var textureMarginTop: Double
Increases the top margin of the 3×3 texture box.
func setExpandMarginAll(size: Double
) Sets the expand margin to
size
pixels for all sides.func setTextureMarginAll(size: Double
) Sets the margin to
size
pixels for all sides.