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


C# ScreenManager.AddScreen方法代码示例

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


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

示例1: Graphics

        public Graphics()
        {
            this.graphics = new GraphicsDeviceManager(this);
            this.graphics.PreferredBackBufferWidth = Convert.ToInt32(ProgramSettings.ResolutionWidth);
            this.graphics.PreferredBackBufferHeight = Convert.ToInt32(ProgramSettings.ResolutionHeight);
            this.graphics.IsFullScreen = ProgramSettings.FullscreenMode;
            Content.RootDirectory = "Content";

            // 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);
            screenManager.GraphicsDeviceManager = this.graphics;

            MultiInputManager manager = new MultiInputManager();
            if (ProgramSettings.KinectEnabled && KinectHelper.Instance().isRunning())
                manager.AddInputDevice(new GestureEventManager());

            screenManager.OtherInput = manager;
            Components.Add(screenManager);

            // Create the first screen
            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(), null);
        }
开发者ID:VincentBLortie,项目名称:Virtual-Anatomy-Lab,代码行数:27,代码来源:Graphics.cs

示例2: Game

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

            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth = SettingsManager.GAME_WIDTH;
            graphics.PreferredBackBufferHeight = SettingsManager.GAME_HEIGHT;
            SettingsManager.GraphicsDevice = graphics;

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

            // frame rate counter for testing
            //Components.Add(new FrameRateCounter(this));

            // initialize resource manager
            ResourceManager.Instance.InitializeContent(this);

            // active the first screens
            // THESE LINES SHOULD BE COMMENTED AND LAST LINE UNCOMMENTED TO INCLUDE INTRO SCREEN AND MENU
            //screenManager.AddScreen(new IntroScreen());
            screenManager.AddScreen(new BackgroundScreen());
            //screenManager.AddScreen(new MainMenuScreen());
            screenManager.AddScreen(new LogoScreen());
            //screenManager.AddScreen(new TextOnBlackScreen("AVANTgarde",  new GameScreen[] { new BackgroundScreen(), new LogoScreen() }));
        }
开发者ID:abcfantasy,项目名称:Green-Time,代码行数:30,代码来源:Game.cs

示例3: Puzzle3D

		public Puzzle3D() {
			if( mInstance != null )
				throw new InvalidOperationException( "Only one instance of Puzzle3D may be created." );

			mInstance = this;

			graphics = new GraphicsDeviceManager( this );
			graphics.MinimumVertexShaderProfile = ShaderProfile.VS_2_0;
			graphics.MinimumPixelShaderProfile = ShaderProfile.PS_2_0;

			graphics.PreferredBackBufferWidth = 800;
			graphics.PreferredBackBufferHeight = 600;
			Window.AllowUserResizing = true;
			graphics.IsFullScreen = false;

			Content.RootDirectory = "Content";

			ScreenManager screenManager = new ScreenManager( this );
			Components.Add( screenManager );

			PictureDatabase.Initialize();
			if( PictureDatabase.Count >= 2 ) {
				screenManager.AddScreen( new MainMenuScreen() );
			} else {
				MessageBoxScreen messageBox = new MessageBoxScreen( "Unable to find enough pictures to play.", false );
				messageBox.Accepted += new EventHandler<EventArgs>( messageBox_Accepted );
				screenManager.AddScreen( messageBox );
			}
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:29,代码来源:Core.cs

示例4: TestSaveLoadOnFile

 public static string TestSaveLoadOnFile(ScreenManager screenMan)
 {
     var text = "__hacknettestaccount";
     var pass = "__testingpassword";
     SaveFileManager.AddUser(text, pass);
     var saveFileNameForUsername = SaveFileManager.GetSaveFileNameForUsername(text);
     OS.TestingPassOnly = true;
     var text2 = "";
     var oS = new OS();
     oS.SaveGameUserName = saveFileNameForUsername;
     oS.SaveUserAccountName = text;
     screenMan.AddScreen(oS, screenMan.controllingPlayer);
     oS.threadedSaveExecute();
     var nodes = oS.netMap.nodes;
     screenMan.RemoveScreen(oS);
     OS.WillLoadSave = true;
     oS = new OS();
     oS.SaveGameUserName = saveFileNameForUsername;
     oS.SaveUserAccountName = text;
     screenMan.AddScreen(oS, screenMan.controllingPlayer);
     var text3 = "Serialization and Integrity Test Report:\r\n";
     Console.WriteLine(text3);
     text2 += text3;
     new List<string>();
     new List<string>();
     var num = 0;
     text2 += getTestingReportForLoadComparison(oS, nodes, num, out num);
     text2 = text2 + "\r\n" + TestMissions(oS);
     for (var i = 0; i < oS.netMap.nodes.Count; i++)
     {
         var root = oS.netMap.nodes[i].files.root;
         DeleteAllFilesRecursivley(root);
     }
     oS.SaveGameUserName = saveFileNameForUsername;
     oS.SaveUserAccountName = text;
     oS.threadedSaveExecute();
     nodes = oS.netMap.nodes;
     screenMan.RemoveScreen(oS);
     OS.WillLoadSave = true;
     oS = new OS();
     oS.SaveGameUserName = saveFileNameForUsername;
     oS.SaveUserAccountName = text;
     screenMan.AddScreen(oS, screenMan.controllingPlayer);
     var num2 = num;
     var testingReportForLoadComparison = getTestingReportForLoadComparison(oS, nodes, num, out num);
     if (num2 != num)
     {
         text2 = text2 + "\r\nAll Files Deleted pass:\r\n" + testingReportForLoadComparison;
     }
     screenMan.RemoveScreen(oS);
     OS.TestingPassOnly = false;
     SaveFileManager.DeleteUser(text);
     var text4 = string.Concat("\r\nTest complete - ", num, " errors found.\r\nTested ", nodes.Count,
         " generated nodes vs ", oS.netMap.nodes.Count, " loaded nodes");
     text2 += text4;
     Console.WriteLine(text4);
     MusicManager.stop();
     return text2;
 }
开发者ID:strangea,项目名称:OpenHacknet,代码行数:59,代码来源:TestSuite.cs

示例5: 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()
        {
            // TODO: Add your initialization logic here

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

            Components.Add(screenManager);

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

            base.Initialize();
        }
开发者ID:LaudableBauble,项目名称:Bedlam,代码行数:21,代码来源:MainOld.cs

示例6: LoadScreen

        static void LoadScreen(ScreenManager screenManager)
        {
            screenManager.AddScreen(screens.mainMenu);

            //screenManager.AddScreen(new Level());
            //screenManager.AddScreen(new InputManager());
        }
开发者ID:tubitos,项目名称:1,代码行数:7,代码来源:Entry.cs

示例7: PongMobile

 public PongMobile()
 {
     graphics = new GraphicsDeviceManager(this);
     //Set the Windows Phone screen resolution
     graphics.PreferredBackBufferWidth = 480;
     graphics.PreferredBackBufferHeight = 800;
     Content.RootDirectory = "Content";
     // Frame rate is 30 fps by default for Windows Phone.
     TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0);
     //Create a new instance of the Screen Manager
     screenManager = new ScreenManager(this);
     Components.Add(screenManager);
     //Add two new screens
     screenManager.AddScreen(new BackgroundScreen());
     screenManager.AddScreen(new LoadingScreen());
 }
开发者ID:lukeyeager,项目名称:CSCE-315-PONG,代码行数:16,代码来源:PongMobile.cs

示例8: Load

        public static void Load(ScreenManager screenManager, bool loadingIsSlow, string message, params GameScreen[] screensToLoad)
        {
            bool screensHaveTransition = false;
            foreach (GameScreen screen in screenManager.Screens)
            {
                _temporaryScreenList.Add(screen);
            }

            // Tell all the current screens to transition off.
            foreach (GameScreen screen in _temporaryScreenList)
            {
                if (screen.TransitionOffTime != TimeSpan.Zero)
                {
                    screensHaveTransition = true;
                }

                screen.ExitScreen();
            }
            _temporaryScreenList.Clear();

            if (screensHaveTransition)
            {
                screenManager.AddScreen(new LoadingScreen(screenManager, loadingIsSlow, message, screensToLoad));
            }
            else
            {
                foreach (GameScreen screen in screensToLoad)
                {
                    screenManager.AddScreen(screen);
                }
            }
        }
开发者ID:JaakkoLipsanen,项目名称:Flai.XNA,代码行数:32,代码来源:LoadingScreen.cs

示例9: Io2GameLibGame

        /// <summary>
        /// Initializes io2GameLib
        /// </summary>
        public Io2GameLibGame()
        {
            // Regular initialization stuff
            Content.RootDirectory = "Content";
            Graphics = new GraphicsDeviceManager(this);
            Graphics.IsFullScreen = true;

            // Extend battery life under lock.
            // InactiveSleepTime = TimeSpan.FromSeconds(1); // CRASH on WIN8

            // Create the settings object
            Settings = new GameLibSettings();

            // Create the screenmanager
            ScreenManager = new ScreenManager(this);
            Components.Add(ScreenManager);

            // Add the default background screen
            ScreenManager.AddScreen(new BackgroundScreen());

            // Let the user get a change to initialize there own services
            InitializeServices();

            // Register the default services
            RegisterDefaultServices();

            // An old construct still alive
            Io2GameLibGame.instance = this;
        }
开发者ID:johankson,项目名称:io2gamelib,代码行数:32,代码来源:GameLibGame.cs

示例10: LoadScreen

 static void LoadScreen(ScreenManager manager)
 {            
     ///add the first screen here
     ///WE ARE ADDING THE DEFERRED SCREEN, you can add wherever you want
     manager.AddScreen(new TemplateDeferredScreen());
     
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:7,代码来源:EngineSetup.cs

示例11: Initialize

        protected override void Initialize()
        {
            manager = new ScreenManager(this, 1600, 960);
            manager.AddScreen(new SplashScreen(new Casino.Menu.Game.CasinoScreen()), PlayerIndex.One);
            Components.Add(manager);

            base.Initialize();
        }
开发者ID:joshsiegl,项目名称:MillionaireEntertainment,代码行数:8,代码来源:Game1.cs

示例12: BomberRush

        public BomberRush()
        {
            // Initialize sound system
            AudioManager.Initialize(this);
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

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

            graphics.IsFullScreen = true;

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

            screenManager.AddScreen(new BackgroundScreen("titleScreen"), null);
            screenManager.AddScreen(new MainMenuScreen(), PlayerIndex.One);
            Components.Add(screenManager);
        }
开发者ID:Lapuh1st,项目名称:BoomGame,代码行数:19,代码来源:BomberRush.cs

示例13: LoadContent

		/// <summary>
		/// LoadContent will be called once per game and is the place to load
		/// all of your content.
		/// </summary>
		protected override void LoadContent() {
			// Create a new SpriteBatch, which can be used to draw textures.
			spriteBatch = new SpriteBatch(GraphicsDevice);

			mScreenMgr = new ScreenManager(this);
			Components.Add(mScreenMgr);
			mScreenMgr.AddScreen(new ScreenGame(mScreenMgr));

			base.LoadContent();
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:14,代码来源:GameSettlers.cs

示例14: Load

        public static void Load(ScreenManager screenManager, NetworkManager nManager, params GameScreen[] screensToLoad)
        {
            // Tell all the current screens to transition off.
            foreach (GameScreen screen in screenManager.GetScreens())
                screen.ExitScreen();

            // create the loading screen and add it to the manager
            LoadingScreen loadingScreen = new LoadingScreen(screenManager, nManager,  screensToLoad);
            screenManager.AddScreen(loadingScreen);
        }
开发者ID:nchoumitsky,项目名称:Meatieroids,代码行数:10,代码来源:LoadingScreen.cs

示例15: Load

        public static void Load(ScreenManager screenManager, bool loadingIsSlow, string message = "Loading...",
                                params GameScreen[] screensToLoad)
        {
            foreach (GameScreen gameScreen in screenManager.GetScreens())
            {
                gameScreen.ExitScreen();
            }

            var loadingScreen = new LoadingScreen(screenManager, loadingIsSlow, screensToLoad) {Message = message};
            screenManager.AddScreen(loadingScreen);
        }
开发者ID:HaKDMoDz,项目名称:DynaInterface,代码行数:11,代码来源:LoadingScreen.cs


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