ActionMode
BaseButton.swift:52enum ActionModeenum ActionModeimport SwiftGodotFramework to write Godot Game Extensions using the Swift Programming Language.
class BaseButtonAbstract base class for GUI buttons.
case pressRequire just a press to consider the button clicked.
case releaseRequire a press and a subsequent release before considering the button clicked.
override class var godotClassName: StringName { get }final var actionMode: BaseButton.ActionMode { get set }Determines when the button is considered clicked, one of the ActionMode constants.
var buttonDown: SimpleSignal { get }Emitted when the button starts being held down.
final var buttonGroup: ButtonGroup? { get set }The ButtonGroup associated with the button. Not to be confused with node groups.
final var buttonMask: MouseButtonMask { get set }Binary mask to choose which mouse buttons this button will respond to.
final var buttonPressed: Bool { get set }If true, the button’s state is pressed. Means the button is pressed down or toggled (if toggleMode is active). Only works if toggleMode is true.
var buttonUp: SimpleSignal { get }Emitted when the button stops being held down.
final var disabled: Bool { get set }If true, the button is in disabled state and can’t be clicked or toggled.
final var keepPressedOutside: Bool { get set }If true, the button stays pressed when moving the cursor outside the button while pressing it.
var pressed: SimpleSignal { get }Emitted when the button is toggled or pressed. This is on [signal button_down] if actionMode is .buttonPress and on [signal button_up] otherwise.
final var shortcut: Shortcut? { get set }Shortcut associated to the button.
final var shortcutFeedback: Bool { get set }If true, the button will highlight for a short amount of time when its shortcut is activated. If false and toggleMode is false, the shortcut will activate without any visual feedback.
final var shortcutInTooltip: Bool { get set }If true, the button will add information about its shortcut in the tooltip.
final var toggleMode: Bool { get set }If true, the button is in toggle mode. Makes the button flip state between pressed and unpressed each time its area is clicked.
var toggled: Signal1 { get }Emitted when the button was just toggled between pressed and normal states (only if toggleMode is active). The new state is contained in the toggledOn argument.
func _pressed() Called when the button is pressed. If you need to know the button’s pressed state (and toggleMode is active), use _toggled(toggledOn:) instead.
func _toggled(toggledOn: Bool) Called when the button is toggled (only if toggleMode is active).
final func getDrawMode() -> BaseButton.DrawMode Returns the visual state used to draw the button. This is useful mainly when implementing your own draw code by either overriding _draw() or connecting to “draw” signal. The visual state of the button is defined by the DrawMode enum.
final func isHovered() -> Bool Returns true if the mouse has entered the button and has not left it yet.
final func setPressedNoSignal(pressed: Bool) Changes the buttonPressed state of the button, without emitting [signal toggled]. Use when you just want to change the state of the button without sending the pressed event (e.g. when initializing scene). Only works if toggleMode is true.
enum DrawModeclass Signal1Signal support.
protocol CaseIterableA type that provides a collection of all of its values.
protocol CustomDebugStringConvertibleA type with a customized textual representation suitable for debugging purposes.
protocol EquatableA type that can be compared for value equality.
protocol Hashable : EquatableA 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.
init?(rawValue: Int64) var debugDescription: String { get }A textual representation of this instance, suitable for debugging
var hashValue: Int { get }static func != (lhs: Self, rhs: Self) -> Bool Returns a Boolean value indicating whether two values are not equal.
func hash(into hasher: inout Hasher)