/// <summary> /// Draw this layer /// </summary> public override void Draw(GameTime gameTime, SpriteBatchIsometric spriteBatch) { // ---------- Begin drawing from this layer's perspective ---------- spriteBatch.Begin( SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, _camTransformation); // ---------- Draw TileSystem ---------- _tileSystem.Draw(gameTime, spriteBatch); // ---------- Draw GameObjects ---------- foreach (GameObject go in _gameObjects) { GOCDrawable drawableComponent = go.GetComponent<GOCDrawable>(); if (drawableComponent != null) drawableComponent.Draw(gameTime, spriteBatch); } // ---------- Drawing complete ---------- spriteBatch.End(); }
/// <summary> /// Draw all data on this GameLayer /// </summary> public virtual void Draw(GameTime gameTime, SpriteBatchIsometric spriteBatch) { // Begin drawing from this GameLayer's perspective spriteBatch.Begin( SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, _camTransformation); // ---------- Start drawing GameObjects ---------- foreach (GameObject go in _gameObjects) { GOCDrawable drawableComponent = go.GetComponent<GOCDrawable>(); if (drawableComponent != null) drawableComponent.Draw(gameTime, spriteBatch); } // ---------- End drawing GameObjects ---------- // End drawing spriteBatch.End(); }