Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | powervette |
The preview is around -70, 20 away from the actual mouse pointer, I have searched and searched for an answer to this, found nothing so far. If i read the function right it returns the mouse pointer position? Is there somewhere I can check the mouse position while the app is running? Or something else to check?
This is for an inventory system, and if I drag the item and drop on a new slot that works fine, so it seem to be getting the proper mouse position, just the preview is so far away.
Thanks
func get_drag_data(_pos):
if slot.item_struct != null:
var preview = TextureRect.new()
preview.texture = slot.item_struct.i_image
preview.expand = true
preview.rect_size = Vector2(24, 24)
preview.add_child(preview)
set_drag_preview(preview)
return slot