Ejemplo n.º 1
0
        public override bool CheckOnClick(DXMAN.DirectInput.xMouse mouse)
        {
            float x = (float)mouse.XPos;
            float y = (float)mouse.YPos;

            float left	 = XPos;
            float right	 = XPos + Width;
            float top	 = YPos;
            float bottom = YPos + Height;

            if(x >= left && x <= right && y >= top && y <= bottom)
            {
                if(mouse.OnClick())
                {
                    return true;
                }
            }

            return false;
        }
Ejemplo n.º 2
0
        public override bool CheckOnClick(DXMAN.DirectInput.xMouse mouse)
        {
            float x1 = (float)mouse.XPos;
            float y1 = (float)mouse.YPos;

            float x2 = XPos + (Width * .5f);
            float y2 = YPos + (Height * .5f);

            double distance = DXMAN.Util.xMath.GetDistance(x1, y1, x2, y2);

            if(distance <= Radius)
            {
                if(mouse.OnClick())
                {
                    return true;
                }
            }

            return false;
        }