private void draw(SpriteBatch spriteBatch) { if (mode != MainGameScreenMode.Exiting) { spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied); spriteBatch.Draw(backgroundTexture, backgroundPosition, TransitionColor); // background cogs foreach (BackgroundCogSprite cog in cogSpritesList) { cog.Draw(spriteBatch, TransitionColor); } // background track spriteBatch.Draw(trackTexture, trackPosition, TransitionColor); spriteBatch.Draw(doorRightShadowTexture, doorRightShadowPosition, TransitionColor); spriteBatch.Draw(doorLeftShadowTexture, doorLeftShadowPosition, TransitionColor); spriteBatch.End(); if (slotPanel != null && slotPanel.PanelState != SlotPanel.SlotPanelState.Closed) { slotPanel.Draw(spriteBatch); } if (pickerPanel != null && pickerPanel.PanelState != PickerPanel.PickerPanelState.Closed && PuzzleEngine.MainScreen != null) { pickerPanel.Draw(spriteBatch); } if (puzzlePanel != null && puzzlePanel.PanelState != PuzzlePanel.PuzzlePanelState.Closed && PuzzleEngine.MainScreen != null) { puzzlePanel.Draw(spriteBatch); } if (creditsPanel != null && creditsPanel.PanelState != CreditsPanel.CreditsPanelState.Closed && PuzzleEngine.MainScreen != null) { creditsPanel.Draw(spriteBatch); } spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied); // draw doors spriteBatch.Draw(doorRightTexture, doorRightPosition, TransitionColor); spriteBatch.Draw(doorLeftTexture, doorLeftPosition, TransitionColor); if (helpPanel != null) { helpPanel.Draw(spriteBatch); } // draw cursor if (puzzlePanel != null && puzzlePanel.PanelState == PuzzlePanel.PuzzlePanelState.Running && PuzzleEngine.IsCursorModeActive && !PuzzleEngine.IsAShapeSelected) { PuzzleEngine.Cursor.Draw(spriteBatch); } spriteBatch.End(); } spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied); spriteBatch.Draw(blankTexture, new Rectangle(0, ShapeShop.PREFERRED_HEIGHT, ShapeShop.PREFERRED_WIDTH, ShapeShop.PREFERRED_HEIGHT), null, Color.Black, 0f, Vector2.Zero, SpriteEffects.None, 0); spriteBatch.Draw(blankTexture, new Rectangle(ShapeShop.PREFERRED_WIDTH, 0, ShapeShop.PREFERRED_WIDTH, ShapeShop.PREFERRED_HEIGHT), null, Color.Black, 0f, Vector2.Zero, SpriteEffects.None, 0); spriteBatch.Draw(blankTexture, new Rectangle(ShapeShop.PREFERRED_WIDTH, ShapeShop.PREFERRED_HEIGHT, ShapeShop.PREFERRED_WIDTH, ShapeShop.PREFERRED_HEIGHT), null, Color.Black, 0f, Vector2.Zero, SpriteEffects.None, 0); spriteBatch.End(); }