public override void Draw(SpriteBatch spriteBatch, GameTime gameTime) { if (!RunningGame) { _game.GraphicsDevice.SetRenderTarget(levelRenderTarget); _game.GraphicsDevice.Clear(MapClearCol); spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend, _game.PointWrap); Background.DrawBackgroundArray(ref BackgroundList, spriteBatch, new Point(MapSize.X * 16, MapSize.Y * 16), MouseIsParralaxPos ? new Vector2(editorMousePos.X, editorMousePos.Y) : Vector2.Zero); foreach (TilesetWorldLayer tswl in TileLayers) { if (tswl.Visible) { tswl.tileSet.DrawTileSet(spriteBatch); } } spriteBatch.End(); _game.GraphicsDevice.SetRenderTarget(null); levelTexture = _imGuiRenderer.BindTexture(levelRenderTarget); } else // Game Running { gameRunner.Draw(gameTime, ref gameRenderTarget); levelTexture = _imGuiRenderer.BindTexture(gameRenderTarget); } }