/// <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); }
public PopupScreen(Game game, Character character) { cursor = (Cursor)game.Services.GetService(typeof(Cursor)); playerManager = (PlayerManager)game.Services.GetService(typeof(PlayerManager)); screenManager = (ScreenManager)game.Services.GetService(typeof(ScreenManager)); map = (BattleMap)game.Services.GetService(typeof(BattleMap)); gameStateManager = (GameStateManager)game.Services.GetService(typeof(GameStateManager)); selectedChar = character; selectScreen = new SelectScreen(game, character); screenManager.AddScreen(selectScreen, null); const string usageText = "A: Move" + "\nX: Attack" + "\nStart: End Turn" + "\nB: Cancel"; this.message = message + usageText; if (selectedChar == null) { this.message = "Start: End Turn" + "\nB: Cancel"; } else if (selectedChar.CharType == "champion") { this.message += "\nY: Buy Mercenary"; } IsPopup = true; TransitionOnTime = TimeSpan.FromSeconds(0.2); TransitionOffTime = TimeSpan.FromSeconds(0.2); menuMove = new InputAction( new Buttons[] { Buttons.A }, new Keys[] { Keys.A }, true); menuAttack = new InputAction( new Buttons[] { Buttons.X, }, new Keys[] { Keys.X }, true); menuCancel = new InputAction( new Buttons[] { Buttons.B, }, new Keys[] { Keys.B }, true); menuEndTurn = new InputAction( new Buttons[] { Buttons.Start, }, new Keys[] { Keys.Enter }, true); menuBuy = new InputAction( new Buttons[] { Buttons.Y, }, new Keys[] { Keys.Y }, true); }
public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; Services.AddService(typeof(List<Character>), charList); gameStateManager = new GameStateManager(); gameStateManager.State = GameState.mainMenu; Services.AddService(typeof(GameStateManager), gameStateManager); screenManager = new ScreenManager(this); Components.Add(screenManager); Services.AddService(typeof(ScreenManager), screenManager); screenManager.AddScreen(new OptionsScreen(this), null); playerManager = new PlayerManager(this); Services.AddService(typeof(PlayerManager), playerManager); AddInitialScreens(); graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; }