Exemplo n.º 1
0
        /// <summary>
        /// Load graphics content for the game.
        /// </summary>
        public override void Activate(bool instancePreserved)
        {
            if (!instancePreserved)
            {
                if (content == null)
                {
                    content = new ContentManager(ScreenManager.Game.Services, "Content");
                }

                SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

                //Create board
                boardHandler = new BoardHandler(X_GRID_VALUE, Y_GRID_VALUE);

                gridTexture = content.Load <Texture2D>("Grid");

                boardHandler.Load(content, spriteBatch);

                font = content.Load <SpriteFont>("gameFont");

                // once the load has finished, we use ResetElapsedTime to tell the game's
                // timing mechanism that we have just finished a very long frame, and that
                // it should not try to catch up.
                ScreenManager.Game.ResetElapsedTime();
            }
        }