drag and drop UI

This commit is contained in:
2026-07-26 17:45:17 +02:00
parent a83fa69c29
commit 1061ae90b1
9 changed files with 168 additions and 63 deletions

View File

@@ -37,12 +37,6 @@ public partial class Meeting : RigidBody2D
}
}
}
if (_isDragging && @event is InputEventMouseButton { Pressed: false })
{
GD.Print("Let me free");
StopDragging();
}
}
public override void _PhysicsProcess(double delta)
@@ -65,15 +59,18 @@ public partial class Meeting : RigidBody2D
private void StartDragging()
{
Freeze = true;
_isDragging = true;
CollisionLayer = 0;
}
LinearVelocity = Vector2.Zero;
AngularVelocity = 0;
RotationDegrees = 0;
private void StopDragging()
{
Freeze = false;
_isDragging = false;
CollisionLayer = 1;
var meetingControl = Instantiator.Instantiate<MeetingControl>();
meetingControl.Meeting = this;
GetParent().AddChild(meetingControl);
meetingControl.StartDrag();
meetingControl.Position = new Vector2(-5000, -5000);
GetParent().RemoveChild(this);
}
}