Esempio n. 1
0
        /// <summary>
        /// The constructor is private: loading screens should
        /// be activated via the static Load method instead.
        /// </summary>
        private LoadingScreen(bool loadingIsSlow, GameScreen[] screensToLoad)
        {
            this._LoadingIsSlow = loadingIsSlow;
            this._ScreensToLoad = screensToLoad;

            TransitionOnTime = TimeSpan.FromSeconds(0.5);
        }
Esempio n. 2
0
 public Camera(GameScreen viewScreen, float screenWidth, float screenHeight, Vector2 startingCenter)
 {
     _Active = true;
     _ViewScreen = viewScreen;
     Vector2 startingTopLeft = startingCenter - new Vector2(screenWidth / 2, screenHeight / 2);
     _ViewScreen.VisibleArea = new BoundingRectangle(startingTopLeft.X, startingTopLeft.Y, screenWidth, screenHeight);
 }
Esempio n. 3
0
        /// <summary>
        /// Adds a new screen to the screen manager.
        /// </summary>
        public static void AddScreen(GameScreen screen)
        {
            _Screens.Add(screen);

            // If we have a graphics device, tell the screen to load content.
            if (_IsInitialized)
            {
                screen.LoadContent();
            }
        }
        public CollisionManager(GameScreen viewScreen, int horizontalGroups = 0, int verticalGroups = 0)
        {
            _ViewScreen = viewScreen;

            if (horizontalGroups > 0)
                _HorizontalGroups = horizontalGroups;
            if (verticalGroups > 0)
                _VerticalGroups = verticalGroups;

            _CurrentCollidableObjects = new List<ICutlassCollidable>[_HorizontalGroups, _VerticalGroups];
        }
Esempio n. 5
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 static 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);
        }