コード例 #1
0
        public MarbletsGame()
#endif
		{
			//Create the content pipeline manager.
			base.Content.RootDirectory = "Content";
			MarbletsGame.Content = base.Content;

			//Set up the device to be HD res. The RelativeSpriteBatch will handle 
			//resizing for us
			graphics = new GraphicsDeviceManager(this);

			// If the window size changes, then our  drawable area changes and the 
			// game graphics might not fit.  
			// Hook into DeviceReset event so we can resize the graphics.
			graphics.DeviceReset += new EventHandler<EventArgs>(OnGraphicsComponentDeviceReset);

			graphics.PreferredBackBufferWidth = 320;
			graphics.PreferredBackBufferHeight = 480;

			Window.AllowUserResizing = true;

			mainGame = 
                new GameScreen(this, "Textures/play_frame", SoundEntry.MusicGame);
			mainGame.Enabled = false;
			mainGame.Visible = false;
			this.Components.Add(mainGame);

			splashScreen = 
                new TitleScreen(this, "Textures/title_frame", SoundEntry.MusicTitle);
			splashScreen.Enabled = true;
			splashScreen.Visible = true;
			this.Components.Add(splashScreen);

			inputHelper = new InputHelper(this);
			inputHelper.UpdateOrder = int.MinValue;
			this.Components.Add(inputHelper);
		}
コード例 #2
0
        public MarbletsGame()
        {
            #if !XBOX360
            //Uncomment this line to force a save of the default settings file. Useful
            //when you had added things to settings.cs
            //project
            //Settings.Save("settings.xml");
            #endif
            Settings = Settings.Load("settings.xml");

            //Create the content pipeline manager.
            base.Content.RootDirectory = "Content";
            MarbletsGame.Content = base.Content;

            //Set up the device to be HD res. The RelativeSpriteBatch will handle
            //resizing for us
            graphics = new GraphicsDeviceManager(this);

            // If the window size changes, then our  drawable area changes and the
            // game graphics might not fit.
            // Hook into DeviceReset event so we can resize the graphics.
            graphics.DeviceReset +=
                new EventHandler(OnGraphicsComponentDeviceReset);

            graphics.PreferredBackBufferWidth = 1024;
            graphics.PreferredBackBufferHeight = 768;

            graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;

            Window.AllowUserResizing = true;

            mainGame = new GameScreen(this, "Textures/play_frame"/* TODO, SoundEntry.MusicGame*/);
            mainGame.Enabled = false;
            mainGame.Visible = false;
            this.Components.Add(mainGame);

            splashScreen = new TitleScreen(this, "Textures/title_frame"/*TODO, SoundEntry.MusicTitle */);
            splashScreen.Enabled = true;
            splashScreen.Visible = true;
            this.Components.Add(splashScreen);

            inputHelper = new InputHelper(this);
            inputHelper.UpdateOrder = int.MinValue;
            this.Components.Add(inputHelper);
            #if !MONOMAC
            this.Components.Add(new GamerServicesComponent(this));
            #endif
        }