1 using Microsoft.Xna.Framework;
10 private Point originalOffset;
12 private Vector2 dragStart;
13 private bool dragStarted;
25 this.elementToMove = elementToMove;
29 protected override void Update(
float deltaTime)
32 base.Update(deltaTime);
40 rect.Location += moveAmount;
42 moveAmount.X += Math.Max(
DragArea.X - rect.X, 0);
43 moveAmount.X -= Math.Max(rect.Right -
DragArea.Right, 0);
44 moveAmount.Y += Math.Max(
DragArea.Y - rect.Y, 0);
45 moveAmount.Y -= Math.Max(rect.Bottom -
DragArea.Bottom, 0);
47 if (moveAmount != Point.Zero)
49 elementToMove.ScreenSpaceOffset += moveAmount;
58 elementToMove.ScreenSpaceOffset = originalOffset;
59 elementToMove.GUIComponent?.Flash();
70 originalOffset = elementToMove.ScreenSpaceOffset;
virtual ComponentState State
IEnumerable< GUIComponent > Children
override void Update(float deltaTime)
GUIDragHandle(RectTransform rectT, RectTransform elementToMove, string style="GUIDragIndicator")
Func< RectTransform, bool > ValidatePosition
static int GraphicsHeight