From e844d77d651a6cd1c6172d3369118da87ff4ca24 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Sat, 1 May 2021 16:09:52 -0700 Subject: [PATCH] fix spritebatch naming --- content/pong/draw_paddle/texture_renderer.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/pong/draw_paddle/texture_renderer.md b/content/pong/draw_paddle/texture_renderer.md index 45e9013..5485199 100644 --- a/content/pong/draw_paddle/texture_renderer.md +++ b/content/pong/draw_paddle/texture_renderer.md @@ -52,11 +52,11 @@ namespace PongFE.Renderers { public class Texture2DRenderer : Renderer { - private readonly SpriteBatch _spriteBatch; + private SpriteBatch SpriteBatch { get; } public Texture2DRenderer(SpriteBatch spriteBatch) { - _spriteBatch = spriteBatch; + SpriteBatch = spriteBatch; } public override void Render(double dt, double alpha) @@ -68,7 +68,7 @@ namespace PongFE.Renderers ref readonly var positionComponent = ref GetComponent(entity); ref readonly var textureComponent = ref GetComponent(entity); - _spriteBatch.Draw( + SpriteBatch.Draw( textureComponent.Texture, positionComponent.Position, null, @@ -130,7 +130,7 @@ Now we can rewrite our SpriteBatch draw call: using PongFE.Extensions; ... - _spriteBatch.Draw( + spriteBatch.Draw( textureComponent.Texture, positionComponent.Position.ToXNAVector(), null,