Esempio n. 1
0
        public override void LoadContent()
        {
            Sortie_ecran  = TypeEcranAnnimation.Rien;
            width         = ScreenManager.GraphicsDevice.Viewport.Width;
            height        = ScreenManager.GraphicsDevice.Viewport.Height;
            bouton_taille = new Vector2((float)(width * 0.4), (float)(height * 0.1));

            jouer       = langue.getString(20);
            quitter     = langue.getString(21);
            rank_string = langue.getString(22);

            position_width_info_joueur = (int)(width * 0.55);
            position_1 = new Vector2((float)(width * 0.05), (float)(height * 0.45));
            position_2 = new Vector2((float)(width * 0.05), (float)(height * 0.6));
            position_3 = new Vector2((float)(width * 0.05), (float)(height * 0.75));

            font_manage     = new Police_Size_Manage(height, width, this);
            font_bouton     = font_manage.Get_Regular_Font();
            font_titre      = font_manage.Get_Bold_Font();
            font_mega_titre = font_manage.Get_Bold_Gros2_Font();
            font_tiny       = font_manage.Get_Regular_Petit_Font();

            r = new Rectangle(0, 0, width, height);
            Rectangle r1, r2, r3;

            r1 = new Rectangle((int)(position_1.X), (int)(position_1.Y), (int)(bouton_taille.X), (int)(bouton_taille.Y));
            r2 = new Rectangle((int)(position_2.X), (int)(position_2.Y), (int)(bouton_taille.X), (int)(bouton_taille.Y));
            r3 = new Rectangle((int)(position_3.X), (int)(position_3.Y), (int)(bouton_taille.X), (int)(bouton_taille.Y));

            int marge = (int)(r1.Height * 0.1);

            bouton_1 = new Bouton(this, r1, font_bouton, jouer, marge, 0, Color.White, color_bouton, font_manage._scale);
            bouton_2 = new Bouton(this, r2, font_bouton, option_string, marge, 0, Color.White, color_bouton, font_manage._scale);
            bouton_3 = new Bouton(this, r3, font_bouton, quitter, marge, 0, Color.White, color_bouton, font_manage._scale);

            id          = (string)IsolatedStorageSettings.ApplicationSettings ["id"];
            player_name = (string)IsolatedStorageSettings.ApplicationSettings ["name"];
            side        = (string)IsolatedStorageSettings.ApplicationSettings ["side"];

            if (IsolatedStorageSettings.ApplicationSettings ["red_win"] != null)
            {
                red_win     = (string)IsolatedStorageSettings.ApplicationSettings ["red_win"];
                green_win   = (string)IsolatedStorageSettings.ApplicationSettings ["green_win"];
                player_elo  = (string)IsolatedStorageSettings.ApplicationSettings ["elo"];
                player_game = (string)IsolatedStorageSettings.ApplicationSettings ["player_game"];
                player_rank = (string)IsolatedStorageSettings.ApplicationSettings ["rank"];
                player_win  = (string)IsolatedStorageSettings.ApplicationSettings ["player_win"];
            }

            if (id != null)
            {
                server.Main_Menu_Info(id, player_name);
            }
            else if (!_name_check)
            {
                server.Check_Name(player_name);
            }

            base.LoadContent();
        }
Esempio n. 2
0
        public override void LoadContent()
        {
            width  = ScreenManager.GraphicsDevice.Viewport.Width;
            height = ScreenManager.GraphicsDevice.Viewport.Height;

            info_bot        = langue.getString(52);
            game_bot_string = langue.getString(54);
            multi_string    = langue.getString(55);
            caca            = langue.getString(53);

            font_manage = new Police_Size_Manage(height, width, this);
            font_bouton = font_manage.Get_Regular_Font();
            font_titre  = font_manage.Get_Bold_Font();
            font_texte  = font_manage.Get_Regular_Petit_Font();

            back          = ScreenManager.Game.Content.Load <Texture2D> ("back");
            position_back = new Vector2((float)(width * 0.05), (float)(height * 0.05));

            bouton_taille = new Vector2((float)(width * 0.5), (float)(height * 0.15));

            position_bouton_1 = new Vector2((float)(width / 2 - bouton_taille.X / 2), (float)(height * 0.3));
            position_bouton_2 = new Vector2((float)(width / 2 - bouton_taille.X / 2), (float)(height * 0.6));

            r1 = new Rectangle((int)(position_bouton_1.X), (int)(position_bouton_1.Y), (int)(bouton_taille.X), (int)(bouton_taille.Y));
            r2 = new Rectangle((int)(position_bouton_2.X), (int)(position_bouton_2.Y), (int)(bouton_taille.X), (int)(bouton_taille.Y));
            int marge = (int)(r1.Height * 0.1);

            bouton_1 = new Bouton(this, r1, font_bouton, game_bot_string, marge, 0, Color.White, color_bouton, font_manage._scale);
            bouton_2 = new Bouton(this, r2, font_bouton, multi_string, marge, 0, Color.White, color_bouton, font_manage._scale);

            _scale = Calcul_Scale_Texture();

            base.LoadContent();
        }