Documentation ¶
Overview ¶
Package BaseButton provides methods for working with BaseButton object instances.
Index ¶
- type ActionMode
- type Advanced
- type Any
- type DrawMode
- type Implementation
- type Instance
- func (self Instance) ActionMode() gdclass.BaseButtonActionMode
- func (self Instance) AsBaseButton() 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) ButtonGroup() [1]gdclass.ButtonGroup
- func (self Instance) ButtonMask() MouseButtonMask
- func (self Instance) ButtonPressed() bool
- func (self Instance) Disabled() bool
- func (self Instance) GetDrawMode() gdclass.BaseButtonDrawMode
- func (self Instance) IsHovered() bool
- func (self Instance) KeepPressedOutside() bool
- func (self Instance) OnButtonDown(cb func())
- func (self Instance) OnButtonUp(cb func())
- func (self Instance) OnPressed(cb func())
- func (self Instance) OnToggled(cb func(toggled_on bool))
- func (self Instance) SetActionMode(value gdclass.BaseButtonActionMode)
- func (self Instance) SetButtonGroup(value [1]gdclass.ButtonGroup)
- func (self Instance) SetButtonMask(value MouseButtonMask)
- func (self Instance) SetButtonPressed(value bool)
- func (self Instance) SetDisabled(value bool)
- func (self Instance) SetKeepPressedOutside(value bool)
- func (self Instance) SetPressedNoSignal(pressed bool)
- func (self Instance) SetShortcut(value [1]gdclass.Shortcut)
- func (self Instance) SetShortcutFeedback(value bool)
- func (self Instance) SetShortcutInTooltip(value bool)
- func (self Instance) SetToggleMode(value bool)
- func (self Instance) Shortcut() [1]gdclass.Shortcut
- func (self Instance) ShortcutFeedback() bool
- func (self Instance) ShortcutInTooltip() bool
- func (self Instance) ToggleMode() bool
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
- type MouseButtonMask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionMode ¶
type ActionMode = gdclass.BaseButtonActionMode //gd:BaseButton.ActionMode
const ( /*Require just a press to consider the button clicked.*/ ActionModeButtonPress ActionMode = 0 /*Require a press and a subsequent release before considering the button clicked.*/ ActionModeButtonRelease ActionMode = 1 )
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 DrawMode ¶
type DrawMode = gdclass.BaseButtonDrawMode //gd:BaseButton.DrawMode
const ( /*The normal state (i.e. not pressed, not hovered, not toggled and enabled) of buttons.*/ DrawNormal DrawMode = 0 /*The state of buttons are pressed.*/ DrawPressed DrawMode = 1 /*The state of buttons are hovered.*/ DrawHover DrawMode = 2 /*The state of buttons are disabled.*/ DrawDisabled DrawMode = 3 /*The state of buttons are both hovered and pressed.*/ DrawHoverPressed DrawMode = 4 )
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
type Instance [1]gdclass.BaseButton
[BaseButton] is an abstract base class for GUI buttons. It doesn't display anything by itself.
See [Interface] for methods that can be overridden by a [Class] that extends it.
%!(EXTRA string=BaseButton)
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) ActionMode ¶
func (self Instance) ActionMode() gdclass.BaseButtonActionMode
func (Instance) AsBaseButton ¶
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) ButtonGroup ¶
func (self Instance) ButtonGroup() [1]gdclass.ButtonGroup
func (Instance) ButtonMask ¶
func (self Instance) ButtonMask() MouseButtonMask
func (Instance) ButtonPressed ¶
func (Instance) GetDrawMode ¶
func (self Instance) GetDrawMode() gdclass.BaseButtonDrawMode
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 [enum DrawMode] enum.
func (Instance) IsHovered ¶
Returns [code]true[/code] if the mouse has entered the button and has not left it yet.
func (Instance) KeepPressedOutside ¶
func (Instance) OnButtonDown ¶
func (self Instance) OnButtonDown(cb func())
func (Instance) OnButtonUp ¶
func (self Instance) OnButtonUp(cb func())
func (Instance) SetActionMode ¶
func (self Instance) SetActionMode(value gdclass.BaseButtonActionMode)
func (Instance) SetButtonGroup ¶
func (self Instance) SetButtonGroup(value [1]gdclass.ButtonGroup)
func (Instance) SetButtonMask ¶
func (self Instance) SetButtonMask(value MouseButtonMask)
func (Instance) SetButtonPressed ¶
func (Instance) SetDisabled ¶
func (Instance) SetKeepPressedOutside ¶
func (Instance) SetPressedNoSignal ¶
Changes the [member button_pressed] 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 [member toggle_mode] is [code]true[/code]. [b]Note:[/b] This method doesn't unpress other buttons in [member button_group].
func (Instance) SetShortcut ¶
func (Instance) SetShortcutFeedback ¶
func (Instance) SetShortcutInTooltip ¶
func (Instance) SetToggleMode ¶
func (Instance) ShortcutFeedback ¶
func (Instance) ShortcutInTooltip ¶
func (Instance) ToggleMode ¶
func (*Instance) UnsafePointer ¶
type Interface ¶
type Interface interface { //Called when the button is pressed. If you need to know the button's pressed state (and [member toggle_mode] is active), use [method _toggled] instead. Pressed() //Called when the button is toggled (only if [member toggle_mode] is active). Toggled(toggled_on bool) }
type MouseButtonMask ¶
type MouseButtonMask int
const ( /*Primary mouse button mask, usually for the left button.*/ MouseButtonMaskLeft MouseButtonMask = 1 /*Secondary mouse button mask, usually for the right button.*/ MouseButtonMaskRight MouseButtonMask = 2 /*Middle mouse button mask.*/ MouseButtonMaskMiddle MouseButtonMask = 4 MouseButtonMaskMbXbutton1 MouseButtonMask = 128 MouseButtonMaskMbXbutton2 MouseButtonMask = 256 )