Hi!
Fairly new to programming here learning the ropes as I go. I'm trying to make a card game like solitaire and I've gotten stuck on a drag/drop problem. Here's my code, fairly simple:
func get_drag_data(_pos):
var drag = TextureRect.new()
drag.texture = texture
drag.rect_scale = Vector2(0.5, 0.5)
set_drag_preview(drag)
return texture
func can_drop_data(_pos, data):
return true
func drop_data(_pos, data):
texture = data
The problem I'm having is I have a texture for an empty space and I don't want the element to be draggable if that's showing. I tried putting in an if statement in the middle of get_drag_data()
but I can't reference that image because it loads as a StreamTexture. Am I even doing this right?