protected void ChangerAvtivationBoutons(bool actif) { foreach (BoutonDeCommande bouton in Composantes.Where(c => c is BoutonDeCommande)) { bouton.EstActif = actif; } }
public override void Initialize() { string HostName = Dns.GetHostName(); IP = Dns.GetHostAddresses(HostName)[1].ToString(); base.Initialize(); Composantes.Add(new Titre(Game, IP, "Arial", new Vector2(3 * Game.Window.ClientBounds.Width / 5, 2 * Game.Window.ClientBounds.Height / 3), "Blanc", false, Color.White)); Activer(); }
public override void Initialize() { LecteurIP = new EntréeDeTexte(Game, new Vector2(3 * Game.Window.ClientBounds.Width / 5, 2 * Game.Window.ClientBounds.Height / 3), "Arial", 14); base.Initialize(); ObjetsSélectionnables.Add(LecteurIP); Composantes.Add(LecteurIP); Activer(); }
public override void Initialize() { base.Initialize(); Composantes.Add(new ArrièrePlan(Game, "FondPause")); Composantes.Add(new BoutonDeCommande(Game, "Continuer", "Arial", "BoutonVert", "BoutonNoir", new Vector2(Game.Window.ClientBounds.Width / 4, Game.Window.ClientBounds.Height / 5), true, Continuer, 0.01f)); Composantes.Add(new BoutonDeCommande(Game, "Rage Quit", "Arial", "BoutonVert", "BoutonNoir", new Vector2(Game.Window.ClientBounds.Width / 4, 4 * Game.Window.ClientBounds.Height / 5), true, Quitter, 0.01f)); Composantes.Add(new BoutonDeCommande(Game, "Options", "Arial", "BoutonVert", "BoutonNoir", new Vector2(Game.Window.ClientBounds.Width / 4, 2 * Game.Window.ClientBounds.Height / 5), true, Option, 0.01f)); Activer(); }
public override void Initialize() { base.Initialize(); Composantes.Add(new ArrièrePlan(Game, "FondMenu")); Composantes.Add(new BoutonDeCommande(Game, "Jouer", "Arial", "BoutonVert", "BoutonNoir", new Vector2(Game.Window.ClientBounds.Width / 5, Game.Window.ClientBounds.Height / 5), true, Jouer, 0.01f)); Composantes.Add(new BoutonDeCommande(Game, "Options", "Arial", "BoutonVert", "BoutonNoir", new Vector2(Game.Window.ClientBounds.Width / 5, 2 * Game.Window.ClientBounds.Height / 5), true, Option, 0.01f)); Composantes.Add(new BoutonDeCommande(Game, "Quitter", "Arial", "BoutonVert", "BoutonNoir", new Vector2(Game.Window.ClientBounds.Width / 5, 4 * Game.Window.ClientBounds.Height / 5), true, Quitter, 0.01f)); Activer(); Enabled = true; }
public override void Initialize() { AffGagnants = new AfficheurGagnants(Game); base.Initialize(); Composantes.Add(new ArrièrePlan(Game, "Herbe")); Composantes.Add(new BoutonDeCommande(Game, "Rejouer", "Arial", "BoutonVert", "BoutonNoir", new Vector2(Game.Window.ClientBounds.Width / 4, Game.Window.ClientBounds.Height / 5), true, Rejouer, 0.01f)); Composantes.Add(new BoutonDeCommande(Game, "Quitter", "Arial", "BoutonVert", "BoutonNoir", new Vector2(Game.Window.ClientBounds.Width / 4, 2 * Game.Window.ClientBounds.Height / 5), true, Quitter, 0.01f)); Composantes.Add(AffGagnants); Activer(); }
public override void Initialize() { ObjetsSélectionnables = new List <ISélectionnable>(); LecteurPort = new EntréeDeTexte(Game, new Vector2(3 * Game.Window.ClientBounds.Width / 5, Game.Window.ClientBounds.Height / 3), "Arial", 6); ObjetsSélectionnables.Add(LecteurPort); base.Initialize(); Composantes.Add(new ArrièrePlan(Game, "Carte")); Composantes.Add(new Titre(Game, "Port : ", "Arial", new Vector2(Game.Window.ClientBounds.Width / 5, Game.Window.ClientBounds.Height / 3), "Blanc", false, Color.White)); Composantes.Add(LecteurPort); Composantes.Add(new Titre(Game, "IP :", "Arial", new Vector2(Game.Window.ClientBounds.Width / 5, 2 * Game.Window.ClientBounds.Height / 3), "Blanc", false, Color.White)); Composantes.Add(new BoutonDeCommande(Game, "OK", "Arial", "BoutonVert", "BoutonNoir", new Vector2(Game.Window.ClientBounds.Width / 2, 4 * Game.Window.ClientBounds.Height / 5), true, Lire, 0.01f)); Composantes.Add(new BoutonDeCommande(Game, "Retour", "Arial", "BoutonVert", "BoutonNoir", new Vector2(Game.Window.ClientBounds.Width / 5, 8 * Game.Window.ClientBounds.Height / 9), true, Retour, 0.01f)); GestionInput = Game.Services.GetService(typeof(InputManager)) as InputManager; }
public override void Initialize() { base.Initialize(); Composantes.Add(new ArrièrePlan(Game, "Neige")); Composantes.Add(new BoutonDeCommande(Game, "Annuler", "Arial", "BoutonVert", "BoutonNoir", new Vector2(Game.Window.ClientBounds.Width / 5, 4 * Game.Window.ClientBounds.Height / 5), true, Annuler, 0.01f)); Composantes.Add(new Titre(Game, "Solo", "Arial", new Vector2(Game.Window.ClientBounds.Width / 5, Game.Window.ClientBounds.Height / 5), "Blanc", false, Color.White)); Composantes.Add(new BoutonDeCommande(Game, "Démarrer", "Arial20", "BoutonVert", "BoutonNoir", new Vector2(Game.Window.ClientBounds.Width / 5, 2 * Game.Window.ClientBounds.Height / 5), true, JouerSolo, 0.01f)); Composantes.Add(new Titre(Game, "MultiJoueur", "Arial", new Vector2(4 * Game.Window.ClientBounds.Width / 5, Game.Window.ClientBounds.Height / 5), "Blanc", false, Color.White)); Composantes.Add(new BoutonDeCommande(Game, "Rejoindre", "Arial20", "BoutonVert", "BoutonNoir", new Vector2(4 * Game.Window.ClientBounds.Width / 5, 1.8f * Game.Window.ClientBounds.Height / 5), true, Rejoindre, 0.01f)); Composantes.Add(new BoutonDeCommande(Game, "Héberger", "Arial20", "BoutonVert", "BoutonNoir", new Vector2(4 * Game.Window.ClientBounds.Width / 5, 2.2f * Game.Window.ClientBounds.Height / 5), true, Héberger, 0.01f)); Activer(); }
public override void Initialize() { Rectangle destination = new Rectangle(Game.Window.ClientBounds.Width / 8, Game.Window.ClientBounds.Height / 8, 3 * Game.Window.ClientBounds.Width / 4, 3 * Game.Window.ClientBounds.Height / 4); List <string> noms = new List <string>(); noms.Add("facile"); noms.Add("moyen"); noms.Add("difficile"); ChoixDifficulté = new DéfileurSprite(Game, noms, new Rectangle(Game.Window.ClientBounds.Width / 8, Game.Window.ClientBounds.Height / 2, 3 * Game.Window.ClientBounds.Width / 4, Game.Window.ClientBounds.Height / 5), 0.001f); Attente = false; Carte = new Sprite(Game, "mappe", destination); GestionInput = Game.Services.GetService(typeof(InputManager)) as InputManager; base.Initialize(); Composantes.Add(new Sprite(Game, "menuOption", destination)); Composantes.Add(new Titre(Game, "Options", "Arial", new Vector2(Game.Window.ClientBounds.Width / 2, Game.Window.ClientBounds.Height / 4), "Blanc", false, Color.White)); Composantes.Add(new BoutonDeCommande(Game, "Retour", "Arial", "BoutonVert", "BoutonNoir", new Vector2(3 * Game.Window.ClientBounds.Width / 4, 3 * Game.Window.ClientBounds.Height / 4), true, Retour, 0.01f)); Composantes.Add(new BoutonDeCommande(Game, "Afficher parcours", "Arial", "BoutonVert", "BoutonNoir", new Vector2(Game.Window.ClientBounds.Width / 2, 2 * Game.Window.ClientBounds.Height / 5), true, AfficherCarte, 0.01f)); Composantes.Add(ChoixDifficulté); Composantes.Add(Carte); Activer(); Carte.Visible = false; }
public override void Initialize() { List <string> noms = new List <string>(); noms.Add("choix1"); noms.Add("choix2"); noms.Add("choix3"); noms.Add("choix4"); LecteurPseudonyme = new EntréeDeTexte(Game, new Vector2(3 * Game.Window.ClientBounds.Width / 4, Game.Window.ClientBounds.Height / 4), "Arial20", 10); ChoixVoiture = new DéfileurSprite(Game, noms, new Rectangle(0, Game.Window.ClientBounds.Height / 3, Game.Window.ClientBounds.Width, 2 * Game.Window.ClientBounds.Height / 3), 0.001f); BtnDémarrer = new BoutonDeCommande(Game, "Démarrer", "Arial", "BoutonVert", "BoutonNoir", new Vector2(2 * Game.Window.ClientBounds.Width / 3, 8 * Game.Window.ClientBounds.Height / 9), false, Démarrer, 0.01f); BtnValider = new BoutonDeCommande(Game, "Valider", "Arial", "BoutonVert", "BoutonNoir", new Vector2(Game.Window.ClientBounds.Width / 3, 8 * Game.Window.ClientBounds.Height / 9), true, Valider, 0.01f); base.Initialize(); Composantes.Add(new ArrièrePlan(Game, "MenuOption")); Composantes.Add(new Titre(Game, "Pseudonyme: ", "Arial", new Vector2(Game.Window.ClientBounds.Width / 4, Game.Window.ClientBounds.Height / 4), "Blanc", false, Color.White)); Composantes.Add(LecteurPseudonyme); Composantes.Add(ChoixVoiture); Composantes.Add(BtnDémarrer); Composantes.Add(BtnValider); Activer(); }