private new void Update() { if (!timerStart.IsRunning) { timerStart.Start(); timerFPS.Start(); } InputManager.Update(); DrawableObject[] objects = DrawableObjects.OrderByDescending(x => x.Order).ToArray(); if (objects.All(x => !x.IsDragging)) { for (int i = 0; i < objects.Count(); i++) { DrawableObject obj = objects[i]; if (obj.Visible) { obj.IsCursorHover = obj.Rectangle.Contains(InputManager.MousePosition0Based); if (obj.IsCursorHover) { if (InputManager.IsMousePressed(MouseButtons.Left)) { obj.IsDragging = true; } for (int y = i + 1; y < objects.Count(); y++) { objects[y].IsCursorHover = false; } break; } } } } else { if (InputManager.IsMouseReleased(MouseButtons.Left)) { foreach (DrawableObject obj in objects) { obj.IsDragging = false; } } } borderDotPen.DashOffset = (float)timerStart.Elapsed.TotalSeconds * -15; ShapeManager.Update(); }
protected override void Update() { base.Update(); ShapeManager.Update(); }