예제 #1
0
파일: MenuPause.cs 프로젝트: HazWard/Tank3D
 public override void Initialize()
 {
     ArrêterJeu();
     ListeGameComponentsTanksDétruits = new List<GameComponent>();
     ImageArrièrePlan = new ArrièrePlan(Game, "Background Transparent 60");
     ReprendreJeu = new BoutonDeCommande(Game, "Reprendre le jeu", "Arial20", "BoutonNormal", "BoutonEnfoncé", new Vector2(3 * Game.Window.ClientBounds.Width / 8f, 6 * Game.Window.ClientBounds.Height / 10f), true, new FonctionÉvénemtielle(Play));
     BtnRetourMenuPrincipal = new BoutonDeCommande(Game, " X ", "Arial20", "BoutonRougeX", "BoutonBleuX", new Vector2(15f * (Game.Window.ClientBounds.Width / 16f), Game.Window.ClientBounds.Height / 10f), true, new FonctionÉvénemtielle(RetournerMenuPrincipal));
     Game.Components.Add(ImageArrièrePlan);
     Game.Components.Add(ReprendreJeu);
     Game.Components.Add(BtnRetourMenuPrincipal);
     base.Initialize();
 }
예제 #2
0
파일: BarreHUD.cs 프로젝트: HazWard/Tank3D
 public BarreHUD(Game game, string nomImage)
     : base(game)
 {
     FiltreÉcran = new ArrièrePlan(game, nomImage);
 }
예제 #3
0
 public void InitializeComponents()
 {
     RessourcesManager<SpriteFont> GestionFont = Services.GetService(typeof(RessourcesManager<SpriteFont>)) as RessourcesManager<SpriteFont>;
     SpriteFont Font = GestionFont.Find("Arial20");
     DimensionTitre = Font.MeasureString(TITRE);
     Titre = new TexteCentré(this, TITRE, "Arial20", new Rectangle(Window.ClientBounds.Width / 2 - 2 * (int)DimensionTitre.X,
                                                           Window.ClientBounds.Height / 5,
                                                           4 * (int)DimensionTitre.X,
                                                           4 * (int)DimensionTitre.Y),
                                                           Color.Black, 0.1f);
     
     ImageArrièrePlan = new ArrièrePlan(this, "Background Tank");
     BtnJouer = new BoutonDeCommande(this, "Jouer", "Arial20", "BoutonNormal", "BoutonNormal", new Vector2(Window.ClientBounds.Width / 2, 4 * Window.ClientBounds.Height / 5f), true, new FonctionÉvénemtielle(DémarrerJeu));
     BtnInstructions = new BoutonDeCommande(this, "Instructions", "Arial20", "BoutonNormal", "BoutonEnfoncé", new Vector2(Window.ClientBounds.Width / 2 - (Window.ClientBounds.Width / 4), 4 * Window.ClientBounds.Height / 5f), true, new FonctionÉvénemtielle(AfficherInstructions));
     BtnOptions = new BoutonDeCommande(this, "Options", "Arial20", "BoutonNormal", "BoutonEnfoncé", new Vector2(Window.ClientBounds.Width / 2 + (Window.ClientBounds.Width / 4), 4 * Window.ClientBounds.Height / 5f), true, new FonctionÉvénemtielle(AfficherOptions));
     BtnQuitter = new BoutonDeCommande(this, "Quitter", "Arial20", "BoutonNormal", "BoutonEnfoncé", new Vector2(5 * Window.ClientBounds.Width / 6, Window.ClientBounds.Height / 5f), true, new FonctionÉvénemtielle(QuitterJeu));
     BtnFermerFenêtre = new BoutonDeCommande(this, " X ", "Arial20", "BoutonRougeX", "BoutonBleuX", new Vector2(9 * Window.ClientBounds.Width / 10, Window.ClientBounds.Height / 5), true, new FonctionÉvénemtielle(Retour));
 }