Пример #1
0
        public FarseerPhysicsGame(UserControl userControl, Canvas drawingCanvas, Canvas debugCanvas, TextBlock txtFPS, TextBlock txtDebug)
            : base(userControl, drawingCanvas, debugCanvas, txtDebug)
        {
            TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 16);
            IsFixedTimeStep   = true;

            //new-up components and add to Game.Components
            ScreenManager = new ScreenManager(this);
            Components.Add(ScreenManager);

            if (txtFPS != null)
            {
                FrameRateCounter frameRateCounter = new FrameRateCounter(ScreenManager, txtFPS);
                Components.Add(frameRateCounter);
            }

            Demo1Screen demo1 = new Demo1Screen();
            Demo2Screen demo2 = new Demo2Screen();
            Demo3Screen demo3 = new Demo3Screen();
            Demo4Screen demo4 = new Demo4Screen();
            Demo5Screen demo5 = new Demo5Screen();
            Demo6Screen demo6 = new Demo6Screen();
            Demo7Screen demo7 = new Demo7Screen();

            ScreenManager.MainMenuScreen.AddMainMenuItem(demo1.GetTitle(), demo1);
            ScreenManager.MainMenuScreen.AddMainMenuItem(demo2.GetTitle(), demo2);
            ScreenManager.MainMenuScreen.AddMainMenuItem(demo3.GetTitle(), demo3);
            ScreenManager.MainMenuScreen.AddMainMenuItem(demo4.GetTitle(), demo4);
            ScreenManager.MainMenuScreen.AddMainMenuItem(demo5.GetTitle(), demo5);
            ScreenManager.MainMenuScreen.AddMainMenuItem(demo6.GetTitle(), demo6);
            ScreenManager.MainMenuScreen.AddMainMenuItem(demo7.GetTitle(), demo7);

            ScreenManager.GoToMainMenu();
        }
Пример #2
0
 /// <summary>
 /// Constructor fills in the menu contents.
 /// </summary>
 public MainMenuScreen()
 {
     MenuEntries.Add(Demo1Screen.GetTitle());
     MenuEntries.Add(Demo2Screen.GetTitle());
     MenuEntries.Add(Demo3Screen.GetTitle());
     MenuEntries.Add(Demo4Screen.GetTitle());
     MenuEntries.Add(Demo5Screen.GetTitle());
     MenuEntries.Add(Demo6Screen.GetTitle());
     MenuEntries.Add(Demo7Screen.GetTitle());
     MenuEntries.Add(Demo8Screen.GetTitle());
     MenuEntries.Add(Demo9Screen.GetTitle());
     MenuEntries.Add(Demo10Screen.GetTitle());
     MenuEntries.Add("Exit");
     LeftBorder = 100;
 }