diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-11-07 13:14:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-07 13:14:32 +0100 |
commit | 1e8b7a160f9bca6283070d741c78ea1be876f662 (patch) | |
tree | b43473461e46b76277434c3566584cd93a13f197 /doc | |
parent | c4ecec1d3362754f7f31ed20409273597cac15da (diff) | |
parent | e4b97b4614d29cf2c0d40afd07288995e2199278 (diff) |
Merge pull request #31209 from ReyAnthony/master
Added more details for set_drag_preview()
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/Control.xml | 13 |
1 files changed, 12 insertions, 1 deletions
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 @@ <argument index="0" name="control" type="Control"> </argument> <description> - 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] </description> </method> <method name="set_end"> |