Beispiel #1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Draw(GameTime gameTime)
        {
            var parameters = GetBeginCallOptions();

            SpriteBatch.Begin(
                parameters.SpriteSortMode,
                parameters.BlendState,
                parameters.SamplerState,
                parameters.DepthStencilState,
                parameters.RasterizerState,
                parameters.Effect,
                parameters.TransformMatrix
                );

            var context = GameContext.CreateDrawContext(this, gameTime);

            for (int i = 0; i < Layers.Count; i++)
            {
                Layers[i].Draw(context);
            }

            SpriteBatch.End();

            base.Draw(gameTime);
        }