From e4b97b4614d29cf2c0d40afd07288995e2199278 Mon Sep 17 00:00:00 2001 From: Anthony Rey Date: Thu, 8 Aug 2019 18:56:37 +0200 Subject: [Doc] Added more details for set_drag_preview() --- doc/classes/Control.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index f5a8683a39..75d5a72fb1 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -652,7 +652,18 @@ - Shows the given control at the mouse pointer. A good time to call this method is in [method get_drag_data]. + Shows the given control at the mouse pointer. A good time to call this method is in [method get_drag_data]. The control must not be in the scene tree. + [codeblock] + export (Color, RGBA) var color = Color(1, 0, 0, 1) + + func get_drag_data(position): + # Use a control that is not in the tree + var cpb = ColorPickerButton.new() + cpb.color = color + cpb.rect_size = Vector2(50, 50) + set_drag_preview(cpb) + return color + [/codeblock] -- cgit v1.2.3