mirror of
https://github.com/tonytins/dressupzack
synced 2025-06-25 16:14:43 -04:00
Tweaked drag and drop script
- Applied new drag & drop architecture to main game scene
This commit is contained in:
parent
9ff5c5aae3
commit
3097f5063a
9 changed files with 111 additions and 132 deletions
|
@ -1,14 +1,23 @@
|
|||
# This project is licensed under the GPL-3.0 license.
|
||||
# See the LICENSE file in the project root for more information.
|
||||
@tool
|
||||
extends Node2D
|
||||
|
||||
@export var group: String = "dropable"
|
||||
@export var texture: Texture2D
|
||||
|
||||
var is_draggable = false
|
||||
var is_inside_dropable = false
|
||||
var body_ref
|
||||
var offset: Vector2
|
||||
|
||||
@onready var sprite = $Sprite2D
|
||||
@onready var collsion = $Area2D/CollisionShape2D
|
||||
|
||||
func _ready():
|
||||
sprite.texture = texture
|
||||
collsion.position = sprite.position
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
if is_draggable:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue