/// <summary> /// The constructor is private: loading screens should /// be activated via the static Load method instead. /// </summary> private IntroScreen(ScreenManager screenManager, bool loadingIsSlow, GameScreen[] screensToLoad) { this.loadingIsSlow = loadingIsSlow; this.screensToLoad = screensToLoad; TransitionOnTime = TimeSpan.FromSeconds(0.5); }
/// <summary> /// Activates the loading screen. /// </summary> public static void Load(ScreenManager screenManager, bool loadingIsSlow, PlayerIndex? controllingPlayer, params GameScreen[] screensToLoad) { // 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(screenManager, loadingIsSlow, screensToLoad); screenManager.AddScreen(loadingScreen, controllingPlayer); }
/// <summary> /// The constructor is private: loading screens should /// be activated via the static Load method instead. /// </summary> private VictoryScreen(ScreenManager screenManager, GameScreen[] screensToLoad) { this.userCancelled = false; firstTimeHandleInput = true; this.screensToLoad = screensToLoad; this.screenManager = screenManager; toGraphButton = new ButtonComponent(screenManager.Game, (int)(Settings.maximumResolution.X - 150), (int)(Settings.maximumResolution.Y - 200), new Rectangle(), GameResources.Inst().GetFont(EFont.MedievalBig), Settings.scaleW(79), Settings.scaleH(66), "HUD/menu_next"); toGraphButton.Actions += ToGraph; toMenuButton = new ButtonComponent(screenManager.Game, 60, (int)(Settings.maximumResolution.Y - 200), new Rectangle(), GameResources.Inst().GetFont(EFont.MedievalBig), Settings.scaleW(79), Settings.scaleH(66), "HUD/hotseat_back"); toMenuButton.Actions += ToMenu; toGraphButton.LoadContent(); toMenuButton.LoadContent(); }
/// <summary> /// Activates the loading screen. /// </summary> public static void Load(ScreenManager screenManager, bool loadingIsSlow, PlayerIndex? controllingPlayer, params GameScreen[] screensToLoad) { bool oneBackground = false; foreach (GameScreen screen in screenManager.GetScreens()) { if(screen is MainMenuScreen) screen.ExitScreen(); if (screen is BackgroundScreen && !oneBackground) oneBackground = true; else if (screen is BackgroundScreen && oneBackground) screen.ExitScreen(); } GameResources.game = screenManager.Game; //screenManager.AddScreen(); screenManager.AddScreen(new GameLoadScreen(screenManager, screensToLoad), controllingPlayer); }
/// <summary> /// The constructor is private: loading screens should /// be activated via the static Load method instead. /// </summary> private GraphScreen(ScreenManager screenManager, GameScreen[] screensToLoad) { graphKind = 0; this.userCancelled = false; this.screensToLoad = screensToLoad; this.screenManager = screenManager; this.primitiveBatch = new PrimitiveBatch(screenManager.GraphicsDevice); windowWidth = screenManager.GraphicsDevice.Viewport.Width; windowHeight = screenManager.GraphicsDevice.Viewport.Height; columnNumber = GameMaster.Inst().GetTurnNumber(); if (SetRowNumber()) ToNextGraph(); toMenuButton = new ButtonComponent(screenManager.Game, 60, (int)(Settings.maximumResolution.Y - 200), new Rectangle(), GameResources.Inst().GetFont(EFont.MedievalBig), Settings.scaleW(79), Settings.scaleH(66), "HUD/hotseat_back"); toMenuButton.Actions += ToMenu; toMenuButton.LoadContent(); nextGraphButton = new ButtonComponent(screenManager.Game, (int)(Settings.maximumResolution.X - 150), (int)(Settings.maximumResolution.Y - 200), new Rectangle(), GameResources.Inst().GetFont(EFont.MedievalBig), Settings.scaleW(79), Settings.scaleH(66), "HUD/menu_next"); nextGraphButton.Actions += NextGraph; nextGraphButton.LoadContent(); }
/// <summary> /// The main game constructor. /// </summary> public ExpanzeGame() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); Settings.GraphicsDeviceManager = graphics; Settings.Game = this; graphics.PreferredBackBufferWidth = 800; graphics.PreferredBackBufferHeight = 600; graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8; graphics.ApplyChanges(); // Create the screen manager component. screenManager = new ScreenManager(this); Components.Add(screenManager); cursorComp = new CustomCursor(this); Components.Add(cursorComp); // Activate the first screens. GameScreen[] gs = { new BackgroundScreen(), new MainMenuScreen() }; IntroScreen.Load(screenManager, true, null, gs); }
/// <summary> /// The constructor is private: loading screens should /// be activated via the static Load method instead. /// </summary> private GameLoadScreen(ScreenManager screenManager, GameScreen[] screensToLoad) { this.screensToLoad = screensToLoad; otherScreensAreGone = false; }