Beispiel #1
0
 private void backButton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     this.game.SetScreen(new MainMenuScreen(this.game, this.framework));
 }
Beispiel #2
0
 private void missionsButton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     this.game.SetScreen(new MissionSelectionScreen(this.game, this.framework));
 }
Beispiel #3
0
 private void exitButton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     this.game.Exit();
 }
Beispiel #4
0
 private void helpButton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     this.game.SetScreen(new HelpScreen(this.game, this.framework));
 }
Beispiel #5
0
        private bool FireMouseDownUpEvent(float x, float y, MouseButton mouseButton, MouseEventType eventType)
        {
            foreach (var child in LogicalChilds)
            {
                if (child.FireMouseDownUpEvent(x, y, mouseButton, eventType))
                    return true;
            }

            if (PositionIsInElement(x, y))
            {
                var args = new MouseButtonEventArgs(x, y, mouseButton);
                switch (eventType)
                {
                    case MouseEventType.MouseDown:
                        MouseDown(this, args);
                        break;
                    case MouseEventType.LeftDown:
                        MouseLeftButtonDown(this, args);
                        break;
                    case MouseEventType.RightDown:
                        MouseRightButtonDown(this, args);
                        break;
                    case MouseEventType.MiddleDown:
                        MouseMiddleButtonDown(this, args);
                        break;
                    case MouseEventType.MouseUp:
                        MouseUp(this, args);
                        break;
                    case MouseEventType.LeftUp:
                        MouseLeftButtonUp(this, args);
                        break;
                    case MouseEventType.RightUp:
                        MouseRightButtonUp(this, args);
                        break;
                    case MouseEventType.MiddleUp:
                        MouseMiddleButtonUp(this, args);
                        break;
                }
                return args.Handled;
            }
            else
            {
                return false;
            }
        }