コード例 #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
ファイル: MarbletsGame.cs プロジェクト: QHebert/monogame
        public MarbletsGame()
        {
            Settings.Load();

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

            //Set up the device to be HD res.
            graphics = new GraphicsDeviceManager(this);

            // Zune use 30 frames per second
            this.TargetElapsedTime = TimeSpan.FromSeconds(1/30.0f);

            // The assets need to be stretched...put some quality
            graphics.PreferMultiSampling = true;

            mainGame = new GameScreen(this, "play_frame_zunehd");
            mainGame.Enabled = false;
            mainGame.Visible = false;
            this.Components.Add(mainGame);

            splashScreen = new TitleScreen(this, "title_frame_zunehd");
            splashScreen.Enabled = true;
            splashScreen.Visible = true;
            this.Components.Add(splashScreen);

            this.Components.Add(new GamerServicesComponent(this));
        }
コード例 #3
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
        }