示例#1
0
文件: Desktop.cs 项目: vb0067/LGame
        /// <summary>
        /// 鼠标运动事件
        /// </summary>
        ///
        private void ProcessTouchMotionEvent()
        {
            if (this.hoverComponent != null && this.hoverComponent.IsEnabled() &&
                input.IsMoving())
            {
                if (this.input.GetTouchDY() != 0 || this.input.GetTouchDY() != 0)
                {
                    this.hoverComponent.ProcessTouchDragged();
                }
            }
            else
            {
                if (Touch.IsDrag() || Touch.IsMove())
                {
                    // 获得当前窗体下鼠标坐标
                    LComponent comp = this.FindComponent(this.input.GetTouchX(),
                                                         this.input.GetTouchY());
                    if (comp != null)
                    {
                        if (this.input.GetTouchDX() != 0 ||
                            this.input.GetTouchDY() != 0)
                        {
                            comp.ProcessTouchMoved();
                        }

                        if (this.hoverComponent == null)
                        {
                            comp.ProcessTouchEntered();
                        }
                        else if (comp != this.hoverComponent)
                        {
                            this.hoverComponent.ProcessTouchExited();
                            comp.ProcessTouchEntered();
                        }
                    }
                    else
                    {
                        if (this.hoverComponent != null)
                        {
                            this.hoverComponent.ProcessTouchExited();
                        }
                    }

                    this.hoverComponent = comp;
                }
            }
        }