From bbc15cba92eec9d4fe366a5f4993af06d50e6015 Mon Sep 17 00:00:00 2001 From: Syntriax Date: Thu, 30 Nov 2023 10:48:57 +0300 Subject: [PATCH] fix: Sprite Batch Exception at Runtime --- Game/Game1.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Game/Game1.cs b/Game/Game1.cs index 93f2f0b..8278dc5 100644 --- a/Game/Game1.cs +++ b/Game/Game1.cs @@ -23,7 +23,6 @@ public class Game1 : Game PreferredBackBufferWidth = 1024, PreferredBackBufferHeight = 576 }; - _spriteBatch = new SpriteBatch(GraphicsDevice); Content.RootDirectory = "Content"; IsMouseVisible = true; @@ -41,6 +40,8 @@ public class Game1 : Game protected override void LoadContent() { + _spriteBatch = new SpriteBatch(GraphicsDevice); + Sprite spriteBox = new Sprite() { Texture2D = Content.Load("Sprites/Pixel") }; Sprite spriteBall = new Sprite() { Texture2D = Content.Load("Sprites/Circle") };