Parcourir la source

Improve descriptions for drag methods

(cherry picked from commit 31a23ab33f6ac80931c7f0027ff4f15f4a3c2172)
kobewi il y a 3 ans
Parent
commit
6891d719f6
3 fichiers modifiés avec 8 ajouts et 3 suppressions
  1. 2 1
      doc/classes/Control.xml
  2. 5 2
      doc/classes/Node.xml
  3. 1 0
      doc/classes/Viewport.xml

+ 2 - 1
doc/classes/Control.xml

@@ -508,7 +508,8 @@
 		<method name="is_drag_successful" qualifiers="const">
 			<return type="bool" />
 			<description>
-				Returns [code]true[/code] if drag operation is successful.
+				Returns [code]true[/code] if a drag operation is successful. Alternative to [method Viewport.gui_is_drag_successful].
+				Best used with [constant Node.NOTIFICATION_DRAG_END].
 			</description>
 		</method>
 		<method name="minimum_size_changed">

+ 5 - 2
doc/classes/Node.xml

@@ -825,10 +825,13 @@
 			Notification received when the node is instanced.
 		</constant>
 		<constant name="NOTIFICATION_DRAG_BEGIN" value="21">
-			Notification received when a drag begins.
+			Notification received when a drag operation begins. All nodes receive this notification, not only the dragged one.
+			Can be triggered either by dragging a [Control] that provides drag data (see [method Control.get_drag_data]) or using [method Control.force_drag].
+			Use [method Viewport.gui_get_drag_data] to get the dragged data.
 		</constant>
 		<constant name="NOTIFICATION_DRAG_END" value="22">
-			Notification received when a drag ends.
+			Notification received when a drag operation ends.
+			Use [method Viewport.gui_is_drag_successful] to check if the drag succeeded.
 		</constant>
 		<constant name="NOTIFICATION_PATH_CHANGED" value="23">
 			Notification received when the node's [NodePath] changed.

+ 1 - 0
doc/classes/Viewport.xml

@@ -124,6 +124,7 @@
 			<return type="bool" />
 			<description>
 				Returns [code]true[/code] if the viewport is currently performing a drag operation.
+				Alternative to [constant Node.NOTIFICATION_DRAG_BEGIN] and [constant Node.NOTIFICATION_DRAG_END] when you prefer polling the value.
 			</description>
 		</method>
 		<method name="input">