Ejemplo n.º 1
0
        private static Vector2 GetXAnchor(MateOptions anchor, MateOptions popup, GuiWidget popupWidget, RectangleDouble bounds)
        {
            if (anchor.Right && popup.Left)
            {
                return(new Vector2(bounds.Width, 0));
            }
            else if (anchor.Left && popup.Right)
            {
                return(new Vector2(-popupWidget.Width, 0));
            }
            else if (anchor.Right && popup.Right)
            {
                return(new Vector2(popupWidget.Width - bounds.Width, 0) * -1);
            }

            return(Vector2.Zero);
        }
Ejemplo n.º 2
0
        private static Vector2 GetYAnchor(MateOptions anchor, MateOptions popup, GuiWidget popupWidget, RectangleDouble bounds)
        {
            if (anchor.Top && popup.Bottom)
            {
                return(new Vector2(0, bounds.Height));
            }
            else if (anchor.Top && popup.Top)
            {
                return(new Vector2(0, popupWidget.Height - bounds.Height) * -1);
            }
            else if (anchor.Bottom && popup.Top)
            {
                return(new Vector2(0, -popupWidget.Height));
            }

            return(Vector2.Zero);
        }