public override void Draw(SuperCaissiere.Engine.Graphics.SpriteBatchProxy spriteBatch) { spriteBatch.Begin(SceneCamera); // les clients foreach (Client cli in liste_client.ToList()) { cli.Draw(spriteBatch); } // La caisse m_cashier.Draw(spriteBatch); foreach (Client cli in liste_client.ToList()) { foreach (ItemBase produits in cli.Items.ToList()) { produits.Draw(spriteBatch); } } // La main en dernier m_hand.Draw(spriteBatch); if (scanner_zone != Rectangle.Empty) { spriteBatch.DrawRectangle(scanner_zone, Color.Red * scanner_color); } spriteBatch.DrawString(Application.MagicContentManager.Font, time.ToString(), new Vector2(10, 10), Color.Chartreuse); //panier.Draw(spriteBatch); spriteBatch.End(); }
public override void Draw(SuperCaissiere.Engine.Graphics.SpriteBatchProxy spriteBatch) { spriteBatch.Begin(SceneCamera); if (m_pauseMidi == false) { spriteBatch.Draw(Application.MagicContentManager.GetTexture("ingamebg"), SceneCamera.VisibilityRectangle, Color.White); // les clients if (m_currentClient != null) m_currentClient.Draw(spriteBatch); // La caisse m_cashier.Draw(spriteBatch); if (m_currentClient != null) { var list = m_currentClient.Items.ToList(); for (int i = list.Count; i > 0; i--) { list[i - 1].Draw(spriteBatch); } } // Le panier //draw models3D if (m_currentProduct != null) { if (!m_manualMode) { spriteBatch.End(); m_render.Draw(); spriteBatch.Begin(SceneCamera); } else { m_barCodeQte.Draw(spriteBatch); } } // La main en dernier m_hand.Draw(spriteBatch); //panier.Draw(spriteBatch); Color color = Color.White; if (m_hp < 90) color = Color.Yellow; if (m_hp < 80) color = Color.YellowGreen; if (m_hp < 70) color = Color.Orange; if (m_hp < 60) color = Color.OrangeRed; if (m_hp < 60) color = Color.Red; if (m_hp < 50) color = Color.RosyBrown; if (m_hp < 40) color = Color.Purple; if (m_hp < 30) color = Color.PowderBlue; if (m_hp < 20) color = Color.MintCream; if (m_hp < 10) color = Color.Black; int d = 0; if (m_hp < 70) d = 1; if (m_hp < 30) d = 2; spriteBatch.DrawString(Application.MagicContentManager.Font, "Bonheur de patron : " + m_hp + " %", new Vector2(Application.Graphics.GraphicsDevice.Viewport.Width - 230, 5), color); Rectangle r = new Rectangle(d * 133, 0, 133, 200); spriteBatch.Draw(Application.MagicContentManager.GetTexture("boss"), m_bossZone, r, Color.White); int size = (int)((m_hp / 100f) * 120f); spriteBatch.DrawRectangle(new Rectangle(Application.Graphics.GraphicsDevice.Viewport.Width - 100, 150 - size, 10, size), color); if (m_rankActive) { spriteBatch.Draw(Application.MagicContentManager.GetTexture("rank"), new Rectangle((Application.Graphics.GraphicsDevice.Viewport.Width - 300) / 2, (Application.Graphics.GraphicsDevice.Viewport.Height - 150) / 2, 300, 150), m_rank, Color.White); } } // Pause du midi else { spriteBatch.Draw(Application.MagicContentManager.GetTexture("ingamebgpause"), SceneCamera.VisibilityRectangle, Color.White); } spriteBatch.DrawString(Application.MagicContentManager.Font, m_time.ToString(), new Vector2(10, 10), Color.Chartreuse); string s = "Magasin profit: "; if (m_magasinCA > 1000000) { s += (m_magasinCA / 1000000).ToString("0.00") + "ME"; } else { s += m_magasinCA.ToString("0.00") + "E"; } spriteBatch.DrawString(Application.MagicContentManager.Font, s, new Vector2(10, 30), Color.Red); spriteBatch.DrawString(Application.MagicContentManager.Font, "Votre profit: " + m_youCA.ToString("0.00") + "E", new Vector2(10, 50), Color.Fuchsia); if (m_textbox != null) m_textbox.Draw(spriteBatch); spriteBatch.End(); }