Ok, so I am trying to create a drag-and-drop interface for a game I am making. I based it off the drag-and-drop demo application. Except instead of trying to a ColorPickerButton around I am trying to drag a TextureButton as the object preview. However, when I try to do this I get this error:
Invalid type in function 'set_normal_texture' in base 'TextureButton'. Cannot convert argument 1 from String to Object.
Could someone please help? Also, here is my code:
extends TextureButton
func get_drag_data(pos):
var obj_prev = TextureButton.new()
obj_prev.set_size(Vector2(50,50))
obj_prev.set_normal_texture('res://Object_moveable.png')
set_drag_preview(obj_prev)
func can_drop_data(pos, data):
I've been scratching my head at this for a while. Any help or suggestion is appreciated!
P.S. my version of Godot is v2.1.3 for your information