当前位置: 首页>>代码示例>>C#>>正文


C# ScreenManager.AddScreen方法代码示例

本文整理汇总了C#中GameStateManagement.ScreenManager.AddScreen方法的典型用法代码示例。如果您正苦于以下问题:C# ScreenManager.AddScreen方法的具体用法?C# ScreenManager.AddScreen怎么用?C# ScreenManager.AddScreen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameStateManagement.ScreenManager的用法示例。


在下文中一共展示了ScreenManager.AddScreen方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GameStateManagementGame

        /// <summary>
        /// The main game constructor.
        /// </summary>
        public GameStateManagementGame()
        {
            instance = this;

            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);

            //graphics.PreferredBackBufferWidth = 853;
            //graphics.PreferredBackBufferHeight = 480;

            graphics.PreferredBackBufferWidth = 640;
            graphics.PreferredBackBufferHeight = 480;
            //graphics.IsFullScreen = true;

            // Create the screen manager component.
            screenManager = new ScreenManager(this);

            contentManager = new ContentManager(screenManager.Game.Services, "Content");

            SoundManager.contentManager = content;
            SoundManager.LoadContent();

            Components.Add(screenManager);

            // Activate the first screens.
            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(), null);
        }
开发者ID:lioralterman,项目名称:xnapacman,代码行数:32,代码来源:Game.cs

示例2: BlackjackGame

        /// <summary>
        /// Initializes a new instance of the game.
        /// </summary>
        public BlackjackGame()
        {
            graphics = new GraphicsDeviceManager(this);

            Content.RootDirectory = "Content";

            screenManager = new ScreenManager(this);

            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(), null);

            Components.Add(screenManager);

            #if WINDOWS || MACOS || LINUX
            IsMouseVisible = true;
            #elif WINDOWS_PHONE || IOS || ANDROID
            // Frame rate is 30 fps by default for Windows Phone.
            TargetElapsedTime = TimeSpan.FromTicks(333333);
            graphics.IsFullScreen = true;
            #else
            Components.Add(new GamerServicesComponent(this));
            #endif

            // Initialize sound system
            AudioManager.Initialize(this);
        }
开发者ID:Ezekoka,项目名称:MonoGame-StarterKits,代码行数:29,代码来源:BlackjackGame.cs

示例3: GameStateManagementGame

        /// <summary>
        /// The main game constructor.
        /// </summary>
        public GameStateManagementGame()
        {
            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);

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

            // Create the screen manager component.
            screenManager = new ScreenManager(this);

            Components.Add(screenManager);

            // Activate the first screens.
            screenManager.AddScreen(new BackgroundScreen());
            screenManager.AddScreen(new MainMenuScreen());

            m_kInfoBox = new Utils.InfoBox(this, new Vector2(Window.ClientBounds.Width, Window.ClientBounds.Height - 10));
            //Components.Add(m_kInfoBox);

            IsFixedTimeStep = true;
            graphics.SynchronizeWithVerticalRetrace = true;

            // For testing purposes, let's disable fixed time step and vsync.
            //IsFixedTimeStep = false;
            //graphics.SynchronizeWithVerticalRetrace = false;
        }
开发者ID:shalynnho,项目名称:airplane,代码行数:31,代码来源:Game.cs

示例4: GameStateManagementGame

        /// <summary>
        /// The main game constructor.
        /// </summary>
        public GameStateManagementGame()
        {
            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);
            graphics.IsFullScreen = true;
            TargetElapsedTime = TimeSpan.FromTicks(333333);

            // you can choose whether you want a landscape or portait
            // game by using one of the two helper functions.
            //InitializePortraitGraphics();
             InitializeLandscapeGraphics();

            // Create the screen manager component.
            screenManager = new ScreenManager(this);

            Components.Add(screenManager);

            // attempt to deserialize the screen manager from disk. if that
            // fails, we add our default screens.
            if (!screenManager.DeserializeState())
            {
                // Activate the first screens.
                screenManager.AddScreen(new MenuBackgroundScreen("mainMenubackground"), null);
                screenManager.AddScreen(new MainMenuScreen(), null);
            }
        }
开发者ID:skakri09,项目名称:GameOfThreeTards-w-xTILE-Farseer,代码行数:30,代码来源:Game.cs

示例5: BlackjackGame

        /// <summary>
        /// Initializes a new instance of the game.
        /// </summary>
        public BlackjackGame()
        {
            graphics = new GraphicsDeviceManager(this);
            
            Content.RootDirectory = "Content";

            screenManager = new ScreenManager(this);

            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(), null);

            Components.Add(screenManager);

#if WINDOWS
            IsMouseVisible = true;
#elif WINDOWS_PHONE
            // Frame rate is 30 fps by default for Windows Phone.
            TargetElapsedTime = TimeSpan.FromTicks(333333);
            graphics.IsFullScreen = true;
#else
            Components.Add(new GamerServicesComponent(this));
#endif

            // Initialize sound system
            AudioManager.Initialize(this);
#if XBOX
            graphics.PreferredBackBufferHeight = graphics.GraphicsDevice.DisplayMode.Height;
            graphics.PreferredBackBufferWidth = graphics.GraphicsDevice.DisplayMode.Width; 
#elif WINDOWS
            graphics.PreferredBackBufferHeight = 480;
            graphics.PreferredBackBufferWidth = 800; 
#endif        
        }
开发者ID:liwq-net,项目名称:SilverSprite,代码行数:36,代码来源:BlackjackGame.cs

示例6: GameStateManagementGame

        /// <summary>
        /// The main game constructor.
        /// </summary>
        public GameStateManagementGame()
        {
            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);
            graphics.IsFullScreen = true;
            TargetElapsedTime = TimeSpan.FromTicks(333333);

            // you can choose whether you want a landscape or portait
            // game by using one of the two helper functions.
            // This game only supports Landscape view, both left and right
            //InitializePortraitGraphics();
            InitializeLandscapeGraphics();
            graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;

            // Create the screen manager component.
            screenManager = new ScreenManager(this);

            // Note make sure to render in correct order
            Components.Add(screenManager);

            // attempt to deserialize the screen manager from disk. if that
            // fails, we add our default screens.
            if (!screenManager.DeserializeState())
            {
                // Activate the first screens.
                screenManager.AddScreen(new BackgroundScreen(), null);
                screenManager.AddScreen(new MainMenuScreen(), null);
            }
        }
开发者ID:bohesp10,项目名称:Game,代码行数:33,代码来源:Game.cs

示例7: CatapultGame

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

            // Frame rate is 30 fps by default for Windows Phone.
            TargetElapsedTime = TimeSpan.FromTicks(333333);

            //Create a new instance of the Screen Manager
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            //Switch to full screen for best game experience
            graphics.IsFullScreen = true;

            //Add two new screens
            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(), null);

            //Create Chooser and Launcher
            InitializeChooserAndLauncher();

            AudioManager.Initialize(this);
            InitializePhoneServices();
        }
开发者ID:elixir67,项目名称:Sandbox,代码行数:25,代码来源:CatapultGame.cs

示例8: CatapultGame

		public CatapultGame ()
		{
			graphics = new GraphicsDeviceManager (this);
			//graphics.SynchronizeWithVerticalRetrace = false;
			Content.RootDirectory = "Content";

			// Frame rate is 30 fps by default for Windows Phone.
			TargetElapsedTime = TimeSpan.FromTicks (333333);

			//Create a new instance of the Screen Manager
			screenManager = new ScreenManager (this);
			
			Components.Add (screenManager);

			Components.Add (new MessageDisplayComponent (this));
			Components.Add (new GamerServicesComponent (this));
			
			//Add two new screens
			screenManager.AddScreen (new BackgroundScreen (), null);
			screenManager.AddScreen (new MainMenuScreen (), null);

			// Listen for invite notification events.
			NetworkSession.InviteAccepted += (sender, e) => NetworkSessionComponent.InviteAccepted (screenManager, e);

			IsMouseVisible = true;
#if !WINDOWS && !XBOX && !MONOMAC && !LINUX
			//Switch to full screen for best game experience
			graphics.IsFullScreen = true;
#else
            graphics.PreferredBackBufferHeight = 480;
            graphics.PreferredBackBufferWidth = 800;
#endif
			AudioManager.Initialize (this);
		}
开发者ID:Nailz,项目名称:MonoGame-Samples,代码行数:34,代码来源:CatapultGame.cs

示例9: Initialize

        /// <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()
        {
            /// FIXME
            /// - You actually want to load the menu first, and the menu will instantiate
            /// GameplayScreen with an attached and loaded Scenario object.
            ScreenManager screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(), null);

            base.Initialize();
        }
开发者ID:ndssia,项目名称:Project-Corsair---Platformer,代码行数:19,代码来源:Game.cs

示例10: LoadContent

        protected override void LoadContent()
        {
            Managers.Content = this.Content;
            Managers.Graphics = this.graphics;
            spriteBatch = new SpriteBatch(GraphicsDevice);

            arial = Content.Load<SpriteFont>("Fonts/Arial");
            comicSans = Content.Load<SpriteFont>("Fonts/ComicSansMS");

            screenManager = new ScreenManager(this);
            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(), null);
        }
开发者ID:Xellss,项目名称:RougyMon,代码行数:13,代码来源:Game1.cs

示例11: GameStateManagementGame

        /// <summary>
        /// The main game constructor.
        /// </summary>
        public GameStateManagementGame()
        {
            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth = 853;
            graphics.PreferredBackBufferHeight = 480;

            // Create the screen manager component.
            screenManager = new ScreenManager(this);

            // Activate the first screens.
            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(), null);
        }
开发者ID:GarethIW,项目名称:GameStateManagement,代码行数:18,代码来源:Game.cs

示例12: SaturnsTurn2Game

        public SaturnsTurn2Game()
        {
            _graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            Window.Title = "Saturn's Turn 2";

            // add screens etc
            screenManager = new ScreenManager(this);

            Components.Add(screenManager);
            //AudioManager.Initialize(this);

            // Activate the first screens.
            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(), null);
        }
开发者ID:urvaius,项目名称:SaturnsTurn2,代码行数:16,代码来源:SaturnsTurn2Game.cs

示例13: Load

 public static void Load(ScreenManager screenManager, bool loadingIsSlow, params GameScreen[] screensToLoad)
 {
     foreach (GameScreen screen in screenManager.GetScreens())
         screen.ExitScreen();
     LoadingScreen loadingScreen = new LoadingScreen(screenManager, loadingIsSlow, screensToLoad);
     screenManager.AddScreen(loadingScreen);
 }
开发者ID:BenFradet,项目名称:OldXnaStuff,代码行数:7,代码来源:LoadingScreen.cs

示例14: GameStateManagementGame

        /// <summary>
        /// The main game constructor.
        /// </summary>
        public GameStateManagementGame()
        {
            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth = 853; // uncomment for non-fullscreenmode
            graphics.PreferredBackBufferHeight = 480; //uncomment for non-fullscreen mode
            graphics.IsFullScreen = true; //  uncoment this to switch to full screen mode when user testing!
            // Create the screen manager component.
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            // Activate the first screens.
            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new SlideMenuScreen(), null);
        }
开发者ID:dangergirl08,项目名称:Imagination-Labs,代码行数:19,代码来源:Game.cs

示例15: SpaceSurvivalGame

        public SpaceSurvivalGame()
        {
            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);

            // Create the screen factory and add it to the Services
            screenFactory = new ScreenFactory();
            Services.AddService(typeof(IScreenFactory), screenFactory);

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

            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(), null);
        }
开发者ID:faudeval,项目名称:projet,代码行数:17,代码来源:SpaceSurvivalGame.cs


注:本文中的GameStateManagement.ScreenManager.AddScreen方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。