Zeplin.Layer.Draw C# (CSharp) Method

Draw() private method

Causes the game objects on this layer to draw themselves.
private Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Time passed since the last call to Update
return void
        internal void Draw(GameTime gameTime)
        {
            Matrix viewMatrix = Matrix.Identity;

            if (!Pinned)
            {
                viewMatrix = Engine.Camera.ComputeViewMatrix(Parallax);
            }

            ZeplinGame.spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.None, viewMatrix);

            foreach (GameObject o in GameObjects)
            {
                if (o.OnDraw != null)
                    o.OnDraw(gameTime);
            }

            ZeplinGame.spriteBatch.End();
        }