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(); }