Пример #1
0
        private void MouseLeftDown_Callback(MouseButtonStateComparision state)
        {
            if (!IsActive)
            {
                return;
            }
            var mouseState = state.GetMouseState();

            Debug(string.Format("MouseLeftDown_Callback() X:{0} Y:{1}", mouseState.New.X, mouseState.New.Y));
            var current = new Point(mouseState.New.X, mouseState.New.Y);
            var sprite  = ScreenManager.GetSpriteAt(current);

            if (sprite == null)
            {
                return;
            }

            var baseSprite = sprite as Sprite;

            if (baseSprite != null)
            {
                var args = new MouseDownEventArgs
                {
                    StateComparision = state,
                };
                baseSprite._InvokeClick(args);
            }
        }
Пример #2
0
        private void MouseLeftUp_Callback(MouseButtonStateComparision state)
        {
            if (!IsActive)
            {
                return;
            }
            var mouseState = state.GetMouseState();

            Debug(string.Format("MouseLeftUp_Callback() X:{0} Y:{1}", mouseState.New.X, mouseState.New.Y));
        }