Enumerationmigueldeicaza.swiftgodot 0.45.0SwiftGodot
StretchMode
TextureButton.swift:18enum StretchMode
Cases
case scale
Scale to fit the node’s bounding rectangle.
case tile
Tile inside the node’s bounding rectangle.
case keep
The texture keeps its original size and stays in the bounding rectangle’s top-left corner.
case keepCentered
The texture keeps its original size and stays centered in the node’s bounding rectangle.
case keepAspect
Scale the texture to fit the node’s bounding rectangle, but maintain the texture’s aspect ratio.
case keepAspectCentered
Scale the texture to fit the node’s bounding rectangle, center it, and maintain its aspect ratio.
case keepAspectCovered
Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node’s limits.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (11) members.
Type members
Instance members
var flipH: Bool
If
true
, texture is flipped horizontally.var flipV: Bool
If
true
, texture is flipped vertically.var ignoreTextureSize: Bool
If
true
, the size of the texture won’t be considered for minimum size calculation, so theTextureButton
can be shrunk down past the texture size.var stretchMode: TextureButton.StretchMode
Controls the texture’s behavior when you resize the node’s bounding rectangle. See the
StretchMode
constants for available options.var textureClickMask: BitMap?
Pure black and white
BitMap
image to use for click detection. On the mask, white pixels represent the button’s clickable area. Use it to create buttons with curved shapes.var textureDisabled: Texture2D?
Texture to display when the node is disabled. See
disabled
.var textureFocused: Texture2D?
Texture to display when the node has mouse or keyboard focus.
textureFocused
is displayed over the base texture, so a partially transparent texture should be used to ensure the base texture remains visible. A texture that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a fully transparent texture of any size. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.var textureHover: Texture2D?
Texture to display when the mouse hovers the node.
var textureNormal: Texture2D?
Texture to display by default, when the node is not in the disabled, hover or pressed state. This texture is still displayed in the focused state, with
textureFocused
drawn on top.var texturePressed: Texture2D?
Texture to display on mouse down over the node, if the node has keyboard focus and the player presses the Enter key or if the player presses the
shortcut
key.
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
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 RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.