Ejemplo n.º 1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

#if WINDOWS
            //Set window defaults. Parent game can override in constructor
            Window.AllowUserResizing = true;
            Window.ClientSizeChanged += WindowClientSizeChanged;
#endif

            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();
            Demo8Screen demo8 = new Demo8Screen();
            Demo9Screen demo9 = new Demo9Screen();
            MainMenuScreen mainMenuScreen = new MainMenuScreen();
            mainMenuScreen.AddMainMenuItem(demo1.GetTitle(), demo1);
            mainMenuScreen.AddMainMenuItem(demo2.GetTitle(), demo2);
            mainMenuScreen.AddMainMenuItem(demo3.GetTitle(), demo3);
            mainMenuScreen.AddMainMenuItem(demo4.GetTitle(), demo4);
            mainMenuScreen.AddMainMenuItem(demo5.GetTitle(), demo5);
            mainMenuScreen.AddMainMenuItem(demo6.GetTitle(), demo6);
            mainMenuScreen.AddMainMenuItem(demo7.GetTitle(), demo7);
            mainMenuScreen.AddMainMenuItem(demo8.GetTitle(), demo8);
            mainMenuScreen.AddMainMenuItem(demo9.GetTitle(), demo9);
            mainMenuScreen.AddMainMenuItem("Exit", null, true);

            ScreenManager.AddScreen(new BackgroundScreen(), null);
            ScreenManager.AddScreen(mainMenuScreen, null);
            ScreenManager.AddScreen(new LogoScreen(TimeSpan.FromSeconds(2.0)), null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

#if WINDOWS
            //Set window defaults. Parent game can override in constructor
            Window.AllowUserResizing  = true;
            Window.ClientSizeChanged += WindowClientSizeChanged;
#endif

            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();
            Demo8Screen    demo8          = new Demo8Screen();
            Demo9Screen    demo9          = new Demo9Screen();
            MainMenuScreen mainMenuScreen = new MainMenuScreen();
            mainMenuScreen.AddMainMenuItem(demo1.GetTitle(), demo1);
            mainMenuScreen.AddMainMenuItem(demo2.GetTitle(), demo2);
            mainMenuScreen.AddMainMenuItem(demo3.GetTitle(), demo3);
            mainMenuScreen.AddMainMenuItem(demo4.GetTitle(), demo4);
            mainMenuScreen.AddMainMenuItem(demo5.GetTitle(), demo5);
            mainMenuScreen.AddMainMenuItem(demo6.GetTitle(), demo6);
            mainMenuScreen.AddMainMenuItem(demo7.GetTitle(), demo7);
            mainMenuScreen.AddMainMenuItem(demo8.GetTitle(), demo8);
            mainMenuScreen.AddMainMenuItem(demo9.GetTitle(), demo9);
            mainMenuScreen.AddMainMenuItem("Exit", null, true);

            ScreenManager.AddScreen(new BackgroundScreen(), null);
            ScreenManager.AddScreen(mainMenuScreen, null);
            ScreenManager.AddScreen(new LogoScreen(TimeSpan.FromSeconds(2.0)), null);
        }