예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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();
        }
예제 #3
0
        /// <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();
        }
예제 #4
0
 /// <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;
 }
예제 #5
0
        /// <summary>
        /// Adds a new screen to the screen manager.
        /// </summary>
        public void AddScreen(GameScreen screen, PlayerIndex? controllingPlayer)
        {
            screen.ControllingPlayer = controllingPlayer;
            screen.ScreenManager = this;
            screen.IsExiting = false;

            // If we have a graphics device, tell the screen to load content.
            if (isInitialized)
            {
                screen.LoadContent();
            }

            screens.Add(screen);

            // update the TouchPanel to respond to gestures this screen is interested in
            TouchPanel.EnabledGestures = screen.EnabledGestures;
        }
예제 #6
0
        /// <summary>
        /// Removes a screen from the screen manager. You should normally
        /// use GameScreen.ExitScreen instead of calling this directly, so
        /// the screen can gradually transition off rather than just being
        /// instantly removed.
        /// </summary>
        public void RemoveScreen(GameScreen screen)
        {
            // If we have a graphics device, tell the screen to unload content.
            if (isInitialized)
            {
                screen.UnloadContent();
            }

            screens.Remove(screen);
            screensToUpdate.Remove(screen);

            // if there is a screen still in the manager, update TouchPanel
            // to respond to gestures that screen is interested in.
            if (screens.Count > 0)
            {
                TouchPanel.EnabledGestures = screens[screens.Count - 1].EnabledGestures;
            }
        }