1
0
Fork 0
mirror of https://github.com/tonytins/dressupzack synced 2025-05-08 14:14:48 -04:00
dressupzack/project/src/ItemDrag.gd
Anthony Wilcox 7216c18d57 Moved sources to /project directory
- Replaced screenshot from Imgur with a local one
2019-01-01 08:48:36 -05:00

16 lines
512 B
GDScript

# Anthony Wilcox licenses this file to you under the GPL license.
# See the LICENSE file in the project root for more information.
extends TextureButton
var item_pos = null
func _on_outfit_gui_input(ev):
if ev is InputEventMouseButton:
if ev.button_index == BUTTON_LEFT:
if ev.pressed:
item_pos = get_global_mouse_position() - rect_global_position
else:
item_pos = null
if ev is InputEventMouseMotion and item_pos != null:
rect_global_position = get_global_mouse_position() - item_pos