1
0
Fork 0
mirror of https://github.com/tonytins/dressupzack synced 2025-05-06 05:44:48 -04:00
dressupzack/scripts/ItemDrag.gd
Anthony Foxclaw 8f6ab4592d Moved entire project to root
- Removed assets and publishing directories
2020-06-21 09:16:37 -04:00

16 lines
512 B
GDScript

# Anthony Wilcox licenses this file to you under the MPL 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