Exemple #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch  = new SpriteBatch(GraphicsDevice);
            _font        = Content.Load <SpriteFont>("default");
            FrameCounter = new FrameCounter(_font);

            // TODO: use this.Content to load your game content here
        }
Exemple #2
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            FrameCounter.Update(gameTime);

            foreach (var screen in Screens)
            {
                screen.Update(gameTime);
            }
            InterfaceStack.Update(gameTime);

            // TODO: Add your update logic here

            base.Update(gameTime);
        }
Exemple #3
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            FrameCounter.CountFrame();



            GraphicsDevice.Clear(Color.Black);
            GraphicsDevice.DepthStencilState = DepthStencilState.Default;
            foreach (var screen in Screens)
            {
                screen.Draw(gameTime);
            }


            DrawDebugText();

            FrameCounter.Draw(spriteBatch);

            InterfaceStack.Draw(spriteBatch);



            base.Draw(gameTime);
        }