Example #1
0
        /// <summary>
        /// 只有在范围内鼠标左键抬起时才
        /// 调用event_OnlyInsideMouseUp()。
        /// </summary>
        public void OnlyInsideMouseLeftUp()
        {
            if (InputStatus.GetButton(InputProperty.LeftButton) == true &&
                Father.Contain(Gui.Position) == false)
            {
                OIMLU_IsDown = true;
                //说明是在外面按下的鼠标
            }

            if (InputStatus.GetButton(InputProperty.LeftButton) == false &&
                OIMLU_Status == true &&
                Father.Contain(Gui.Position) &&
                OIMLU_IsDown == true)

            {
                event_OnlyInsideMouseLeftUp();
            }


            if (InputStatus.GetButton(InputProperty.LeftButton) == false)
            {
                OIMLU_IsDown = false;
            }

            OIMLU_Status = InputStatus.GetButton(InputProperty.LeftButton);//鼠标持续状态
        }
Example #2
0
 public void InsideMouseLeftDown()
 {
     if (InputStatus.GetButton(InputProperty.LeftButton) == true &&
         Father.Contain(Gui.Position) == true)
     {
         event_InsideMouseLeftDown();
     }
 }
Example #3
0
        public void InsideMouseRightUp()
        {
            if (InputStatus.GetButton(InputProperty.RightButton) == false &&
                IMRU_lastMouseStatus == true &&
                Father.Contain(Gui.Position))

            {
                event_InsideMouseRightUp();
            }

            IMRU_lastMouseStatus = InputStatus.GetButton(InputProperty.RightButton);
        }
Example #4
0
 public void Update_Event_Down(int index)
 {
     if (index >= keyCodes.Count)
     {
         return;
     }
     if (InputStatus.GetButton(StringOf(keyCodes[index])) == true)
     {
         keyEvent_Downs[index]();
     }
     OnceDowns[index] = !InputStatus.GetButton(StringOf(keyCodes[index]));
 }
Example #5
0
 protected override void Update(float delta)
 {
     if (Contain(Gui.Position) && InputStatus.GetButton(InputProperty.LeftButton))
     {
         if (this.ElementsGoWithMouse.Count != 0)
         {
             if (this.ElementsGoWithMouse[0] is GuiCard)
             {
                 var temp = (GuiCard)ElementsGoWithMouse[0];
                 temp.MouseDownContainer = null;
             }
         }
     }
     base.Update(delta);
     IfMoveToPlaceLayer();
     GoWithMouse();
     ListenAndDo();
 }
Example #6
0
        public void InsideMouseLeftOnceDown()
        {
            if (InputStatus.GetButton(InputProperty.LeftButton) == true &&
                Father.Contain(Gui.Position) == true)
            {
                IMLOD_already = false;
            }

            if (InputStatus.GetButton(InputProperty.LeftButton) == true &&
                Father.Contain(Gui.Position) == true &&
                IMLOD_already)
            {
                event_InsideMouseLeftOnceDown();
                IMLOD_already = false;
            }

            if (InputStatus.GetButton(InputProperty.LeftButton) == false &&
                Father.Contain(Gui.Position))
            {
                IMLOD_already = true;
            }
        }
Example #7
0
        /// <summary>
        /// 当鼠标以左键按下状态从内部移出范围时
        /// </summary>
        public void MouseDownDragOutside()
        {
            if (InputStatus.GetButton(InputProperty.LeftButton) == true &&
                Father.Contain(Gui.Position) == true)
            //鼠标以按下的状态,存在于范围内
            {
                MDDO_IsDown = true;
            }

            if (InputStatus.GetButton(InputProperty.LeftButton) == true &&
                Father.Contain(Gui.Position) == false &&
                MDDO_IsDown == true &&
                MDDO_Status == true)
            //鼠标曾以按下的状态,存在于范围内
            //此时不在范围内,并且鼠标现在还是按下状态
            {
                event_MouseDownDragOutside();
                MDDO_already = true;
            }

            if (MDDO_already &&
                InputStatus.GetButton(InputProperty.LeftButton) == false &&
                Father.Contain(Gui.Position) == false)
            {
                event_MouseDownDragOutside_MouseUp();
                MDDO_already = false;
            }

            if (InputStatus.GetButton(InputProperty.LeftButton) == false)
            {
                MDDO_IsDown = false;
            }


            MDDO_Status = InputStatus.GetButton(InputProperty.LeftButton);
        }
Example #8
0
        /// <summary>
        /// 当鼠标左键以按下状态从外部进入范围内
        /// </summary>
        public void MouseDownDragInside()
        {
            if (InputStatus.GetButton(InputProperty.LeftButton) == true &&
                Father.Contain(Gui.Position) == false)
            {
                MDDI_IsDown = true;
                //说明是在外面按下的鼠标
            }

            if (InputStatus.GetButton(InputProperty.LeftButton) == true &&
                Father.Contain(Gui.Position) == true &&
                MDDI_IsDown == true &&
                MDDI_Status == true)
            {
                event_MouseDownDragInside();
            }

            if (InputStatus.GetButton(InputProperty.LeftButton) == false)
            {
                MDDI_IsDown = false;
            }

            MDDI_Status = InputStatus.GetButton(InputProperty.LeftButton);
        }