Exemple #1
0
        public static void Update()
        {
            if (Drag != null)
            {
                if (Mouse.IsButtonPressed(Mouse.Button.Left))
                {
                    var mousePosLocal = Mouse.GetPosition(Program.Window);
                    Drag.Position = mousePosLocal - Drag.DragOffset;
                }
                else
                {
                    if (Over != null)
                    {
                        Over.OnDrop(Drag);
                    }
                    else
                    {
                        Drag.OnCancelDrag();
                    }

                    Drag = null;
                }
            }

            foreach (var c in controls)
            {
                c.Update();
            }
        }