Example #1
0
        public void CopyDrag(MenuDrag _element)
        {
            label = _element.label;
            anchor = _element.anchor;
            textEffects = _element.textEffects;
            dragRect = _element.dragRect;
            dragType = _element.dragType;
            elementName = _element.elementName;

            base.Copy (_element);
        }
Example #2
0
 /**
  * <summary>Assigns a MenuDrag element as the one to drag.</summary>
  * <param name = "menuDrag">The MenuDrag to begin dragging</param>
  */
 public void SetActiveDragElement(MenuDrag menuDrag)
 {
     activeDragElement = menuDrag;
 }
Example #3
0
        /**
         * Draws a drag-line on screen if the chosen movement method allows for one.
         */
        public void DrawDragLine()
        {
            if (dragState == DragState.Player && KickStarter.settingsManager.movementMethod != MovementMethod.StraightToCursor && KickStarter.settingsManager.drawDragLine)
            {
                Vector2 pointA = dragStartPosition;
                Vector2 pointB = GetInvertedMouse ();

                if (pointB.x >= 0f)
                {
                    DrawStraightLine.Draw (pointA, pointB, KickStarter.settingsManager.dragLineColor, KickStarter.settingsManager.dragLineWidth, true);
                }
            }

            if (activeDragElement != null)
            {
                if (mouseState == MouseState.HeldDown)
                {
                    if (!activeDragElement.DoDrag (GetDragVector ()))
                    {
                        activeDragElement = null;
                    }
                }
                else if (mouseState == MouseState.Normal)
                {
                    if (activeDragElement.CheckStop (GetInvertedMouse ()))
                    {
                        activeDragElement = null;
                    }
                }
            }
        }