summaryrefslogtreecommitdiff
path: root/doc/classes/BaseButton.xml
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-07-14 15:05:50 +0200
committerGitHub <noreply@github.com>2021-07-14 15:05:50 +0200
commit29c56f33a4108429ce4488784d9daff1e1f620b8 (patch)
treee5cd0e7cb7ebbfa7131874ff3c15b91cb5384d62 /doc/classes/BaseButton.xml
parent8f6240a275bbe138e0b52e643583c2fed2211ee4 (diff)
parent50c63bdc4ca6239d06ddf5a63557aadd0c405770 (diff)
Merge pull request #48502 from KoBeWi/visual_button
Add set_pressed_no_signal method to BaseButton
Diffstat (limited to 'doc/classes/BaseButton.xml')
-rw-r--r--doc/classes/BaseButton.xml13
1 files changed, 12 insertions, 1 deletions
diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml
index f7e31f5f9c..d842bac54a 100644
--- a/doc/classes/BaseButton.xml
+++ b/doc/classes/BaseButton.xml
@@ -39,6 +39,16 @@
Returns [code]true[/code] if the mouse has entered the button and has not left it yet.
</description>
</method>
+ <method name="set_pressed_no_signal">
+ <return type="void">
+ </return>
+ <argument index="0" name="pressed" type="bool">
+ </argument>
+ <description>
+ Changes the [member 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].
+ </description>
+ </method>
</methods>
<members>
<member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" enum="BaseButton.ActionMode" default="1">
@@ -60,7 +70,8 @@
[b]Note:[/b] This property only affects the button's visual appearance. Signals will be emitted at the same moment regardless of this property's value.
</member>
<member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false">
- If [code]true[/code], the button's state is pressed. Means the button is pressed down or toggled (if [member toggle_mode] is active).
+ If [code]true[/code], the button's state is pressed. Means the button is pressed down or toggled (if [member toggle_mode] is active). Only works if [member toggle_mode] is [code]true[/code].
+ [b]Note:[/b] Setting [member pressed] will result in [signal toggled] to be emitted. If you want to change the pressed state without emitting that signal, use [method set_pressed_no_signal].
</member>
<member name="shortcut" type="Shortcut" setter="set_shortcut" getter="get_shortcut">
[Shortcut] associated to the button.