public VectorRumbleGame()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            #if WINDOWS_PHONE || IOS || ANDROID // WP7, iPad or Tablets only
            graphics.PreferredBackBufferWidth = 800;
            graphics.PreferredBackBufferHeight = 480;
            graphics.IsFullScreen = true;
            graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft;
            TouchPanel.EnabledGestures = GestureType.Tap;
            #else
            graphics.PreferredBackBufferWidth = 1280;
            graphics.PreferredBackBufferHeight = 720;
            #endif
            graphics.SynchronizeWithVerticalRetrace = true;

            // create the screen manager
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            // create the audio manager
            audioManager = new AudioManager(this,
                "Content/Audio/VectorRumble.xgs",
                "Content/Audio/VectorRumble.xwb",
                "Content/Audio/VectorRumble.xsb");
            Services.AddService(typeof(AudioManager), audioManager);
        }
        /// <summary>
        /// Activates the loading screen.
        /// </summary>
        public static void Load(ScreenManager screenManager,
            EventHandler<EventArgs> loadNextScreen,
            bool loadingIsSlow)
        {
            // Tell all the current screens to transition off.
            foreach (GameScreen screen in screenManager.GetScreens())
                screen.ExitScreen();

            // Create and activate the loading screen.
            LoadingScreen loadingScreen = new LoadingScreen();

            loadingScreen.loadingIsSlow = loadingIsSlow;
            loadingScreen.loadNextScreen = loadNextScreen;

            screenManager.AddScreen(loadingScreen);
        }
Exemple #3
0
 /// <summary>
 /// Event handler for when the user selects ok on the "are you sure
 /// you want to exit" message box.
 /// </summary>
 void LoadMainMenuScreen(object sender, EventArgs e)
 {
     ScreenManager.AddScreen(new BackgroundScreen());
     ScreenManager.AddScreen(new MainMenuScreen());
 }