private void LoadContent()
        {
            width         = _screen.ScreenManager.GraphicsDevice.Viewport.Width;
            height        = _screen.ScreenManager.GraphicsDevice.Viewport.Height;
            bouton_taille = new Vector2((float)(width * 0.4), (float)(height * 0.1));

            option_1_string = langue.getString(19);
            option_2_string = langue.getString(7);
            info            = langue.getString(38);

            font_manage  = new Police_Size_Manage(height, width, _screen);
            font_bold    = font_manage.Get_Bold_Font();
            font_regular = font_manage.Get_Regular_Font();

            bouton_taille = new Vector2((float)(width * 0.4), (float)(height * 0.1));

            position_bouton_1 = new Vector2((float)(width * 0.05), (float)(height * 0.7));
            position_bouton_2 = new Vector2((float)(width * 0.55), (float)(height * 0.7));

            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));
            marge = (int)(r1.Height * 0.1);

            bouton_1 = new Bouton(_screen, r1, font_regular, option_1_string, marge, 0, Color.White, color_bouton, font_manage._scale);
            bouton_2 = new Bouton(_screen, r2, font_regular, option_2_string, marge, 0, Color.White, color_bouton, font_manage._scale);
        }
Пример #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();
        }
Пример #3
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();
        }
Пример #4
0
        public override void LoadContent()
        {
            width  = ScreenManager.GraphicsDevice.Viewport.Width;
            height = ScreenManager.GraphicsDevice.Viewport.Height;

            caca        = langue.getString(42);
            side_string = langue.getString(39);
            name_string = langue.getString(40);
            help_string = langue.getString(41);

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

            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 * 0.5 - bouton_taille.X / 2), (float)(height * 0.3));
            position_bouton_2 = new Vector2((float)(width * 0.5 - bouton_taille.X / 2), (float)(height * 0.5));
            position_bouton_3 = new Vector2((float)(width * 0.5 - bouton_taille.X / 2), (float)(height * 0.7));

            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));
            r3 = new Rectangle((int)(position_bouton_3.X), (int)(position_bouton_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, side_string, marge, 0, Color.White, color_bouton, _scale);
            bouton_2 = new Bouton(this, r2, font_bouton, name_string, marge, 0, Color.White, color_bouton, _scale);
            bouton_3 = new Bouton(this, r3, font_bouton, help_string, marge, 0, Color.White, color_bouton, _scale);

            base.LoadContent();
        }
Пример #5
0
        private void Statut_Loading()
        {
            string caca = wait_string;

            bouton_1       = new Bouton(this, r1, font_texte, caca, marge, 0, Color.White, color_case_vide, font_manage._scale);
            _statut_bouton = Statut_Bouton.Attente_Verification;
            int height_loading = (int)(r1.Height / 2);

            _loading = new LoadingSprite(this, height_loading, new Vector2(r1.X + (r1.Width / 2 - font_texte.MeasureString(caca).X *font_manage._scale / 2 - height_loading), r1.Y + r1.Height / 2), Color.White);

            server.Check_Name(_name);
        }
        public override void LoadContent()
        {
            width  = ScreenManager.GraphicsDevice.Viewport.Width;
            height = ScreenManager.GraphicsDevice.Viewport.Height;
            r      = new Rectangle(0, 0, width, height);

            font_manage = new Police_Size_Manage(height, width, this);
            font        = font_manage.Get_Regular_Font();

            string_1        = langue.getString(43);
            bouton_1_string = langue.getString(44);
            bouton_2_string = langue.getString(21);

            _no_co = new No_Connection_POPUP(this);

            _code = (string)IsolatedStorageSettings.ApplicationSettings ["code"];
            _id   = (string)IsolatedStorageSettings.ApplicationSettings ["id"];

            int _loading_height = (int)(width * 0.05);

            _position_texte   = new Vector2((float)(width / 2 - font.MeasureString(string_1).X *font_manage._scale / 2), (float)(height * 0.3));
            _position_loading = new Vector2((float)(width * 0.6 + font.MeasureString(string_1).X *font_manage._scale / 2), (float)(height * 0.3 + font.MeasureString(string_1).Y *font_manage._scale / 2));

            Vector2 bouton_taille     = new Vector2((float)(width * 0.5), (float)(height * 0.15));
            Vector2 position_bouton_1 = new Vector2((float)(width / 2 - bouton_taille.X / 2), (float)(height * 0.45));

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

            _bouton_1 = new Bouton(this, r1, font, bouton_1_string, marge, 0, Color.White, color_bouton, font_manage._scale);
            _bouton_2 = new Bouton(this, r2, font, bouton_2_string, marge, 0, Color.White, color_bouton, font_manage._scale);

            _loading = new LoadingSprite(this, _loading_height, _position_loading, color_texte);

            if (server == null)
            {
                server = new Echange_Server_Class();
                server.Ajout_Joueur_Liste_Attente(_id, _code);
            }
            else
            {
                if (!server.Echange_en_cours)
                {
                    server.Verifier_Partie_trouver(_id, _code);
                }
            }
            popup = new Adversaire_Found_POPUP(this, server);

            base.LoadContent();
        }
Пример #7
0
        private void Statut_Envoie()
        {
            string caca = wait_creation_string;

            bouton_1       = new Bouton(this, r1, font_texte, caca, marge, 0, Color.White, color_green, font_manage._scale * 0.8f);
            _statut_bouton = Statut_Bouton.Envoie_Confirmation;
            int height_loading = (int)(r1.Height / 4);

            _loading = new LoadingSprite(this, height_loading, new Vector2((float)(r1.X + (r1.Width * 0.1)), r1.Y + r1.Height / 2), Color.White);

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

            server.Nouveau_Joueur(_name, side);
        }
Пример #8
0
        public override void LoadContent()
        {
            width  = ScreenManager.GraphicsDevice.Viewport.Width;
            height = ScreenManager.GraphicsDevice.Viewport.Height;

            font_manage   = new Police_Size_Manage(height, width, this);
            font_1        = font_manage.Get_Bold_Font();
            font_texte    = font_manage.Get_Regular_Font();
            font_keyboard = font_manage.Get_Keyboard_Font();

            _name_string          = langue.getString(29);
            _name_restrict_string = langue.getString(30) + nombre_max_name.ToString() + " " + langue.getString(31);
            _name_nbr_limit       = langue.getString(32);
            _name_less_15         = langue.getString(33) + nombre_max_name.ToString() + " " + langue.getString(31);
            check_string          = langue.getString(28);
            wait_string           = langue.getString(35);
            wait_creation_string  = langue.getString(37);
            deja_pris_string      = langue.getString(34);
            tap_confirm_string    = langue.getString(36);

            _no_co = new No_Connection_POPUP(this);

            effacer = ScreenManager.Game.Content.Load <Texture2D> ("clear");

            texte_taille = new Vector2((float)(width * 0.9), (float)(height * 0.08));
            keyboard     = new Keyboard((int)(height * 0.5), font_keyboard, effacer, width, height, font_manage._scale);

            position_texte = new Vector2((float)(width / 2 - texte_taille.X / 2), (float)(height * 0.2));

            CaseLettre = rectangle.Texture_Rounded_Rectangle(ScreenManager.GraphicsDevice, (int)texte_taille.X, (int)texte_taille.Y, Color.White, (int)(texte_taille.Y * 0.1), (int)(texte_taille.Y * 0.1));

            bouton_taille = new Vector2((float)(width * 0.8), (float)(height * 0.1));

            position_bouton_1 = new Vector2((float)(width * 0.1), (float)(height * 0.3));

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

            bouton_1 = new Bouton(this, r1, font_texte, check_string, marge, 0, Color.White, color_bouton, font_manage._scale);

            _quit_texture  = ScreenManager.Game.Content.Load <Texture2D> ("cancel");
            _quit_position = new Vector2((float)(width - (_quit_texture.Width * font_manage._scale) - width * 0.02), (float)(height * 0.01));

            base.LoadContent();
        }
        private void LoadContent()
        {
            width         = _screen.ScreenManager.GraphicsDevice.Viewport.Width;
            height        = _screen.ScreenManager.GraphicsDevice.Viewport.Height;
            bouton_taille = new Vector2((float)(width * 0.4), (float)(height * 0.1));

            info                       = langue.getString(13);
            string_accept              = langue.getString(14);
            string_refuse              = langue.getString(15);
            string_wait_adversaire     = langue.getString(16);
            string_time                = langue.getString(17);
            string_adversaire_refuse   = langue.getString(18);
            string_menu                = langue.getString(7);
            string_retour_file_attente = langue.getString(19);

            font_manage  = new Police_Size_Manage(height, width, _screen);
            font_bold    = font_manage.Get_Bold_Font();
            font_regular = font_manage.Get_Regular_Font();
            font_gros    = font_manage.Get_Bold_Gros_Font();

            _id   = (string)IsolatedStorageSettings.ApplicationSettings ["id"];
            _code = (string)IsolatedStorageSettings.ApplicationSettings ["code"];


            bouton_taille = new Vector2((float)(width * 0.4), (float)(height * 0.1));

            position_bouton_1 = new Vector2((float)(width * 0.05), (float)(height * 0.65));
            position_bouton_2 = new Vector2((float)(width * 0.55), (float)(height * 0.65));

            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));
            marge = (int)(r1.Height * 0.1);

            bouton_1 = new Bouton(_screen, r1, font_regular, string_accept, marge, 0, Color.White, color_bouton, font_manage._scale);
            bouton_2 = new Bouton(_screen, r2, font_regular, string_refuse, marge, 0, Color.White, color_bouton, font_manage._scale);

            int _loading_height = (int)(width * 0.05);

            _position_texte   = new Vector2((float)(width / 2 - font_bold.MeasureString(string_wait_adversaire).X *font_manage._scale / 2), (float)(height * 0.3));
            _position_loading = new Vector2((float)(width * 0.6 + font_regular.MeasureString(string_wait_adversaire).X *font_manage._scale / 2), (float)(height * 0.3 + font_regular.MeasureString(string_wait_adversaire).Y *font_manage._scale / 2));

            _loading = new LoadingSprite(_screen, _loading_height, _position_loading, color_texte);
        }
Пример #10
0
 private void Statut_Bon()
 {
     bouton_1       = new Bouton(this, r1, font_texte, tap_confirm_string, marge, 0, Color.White, color_green, font_manage._scale);
     _statut_bouton = Statut_Bouton.Attente_Confirmation;
 }
Пример #11
0
 private void Statut_Already_Take()
 {
     bouton_1       = new Bouton(this, r1, font_texte, deja_pris_string, marge, 0, Color.White, color_red, font_manage._scale);
     _statut_bouton = Statut_Bouton.Deja_Pris;
 }
Пример #12
0
 private void Statut_Normal()
 {
     bouton_1       = new Bouton(this, r1, font_texte, check_string, marge, 0, Color.White, color_bouton, font_manage._scale);
     _statut_bouton = Statut_Bouton.Normal;
 }
Пример #13
0
        private void LoadContent()
        {
            width         = _screen.ScreenManager.GraphicsDevice.Viewport.Width;
            height        = _screen.ScreenManager.GraphicsDevice.Viewport.Height;
            bouton_taille = new Vector2((float)(width * 0.4), (float)(height * 0.1));

            string_win     = langue.getString(1);
            string_loose   = langue.getString(2);
            string_draw    = langue.getString(3);
            string_elo     = langue.getString(4);
            string_rank    = langue.getString(5);
            string_rejouer = langue.getString(6);
            string_quit    = langue.getString(7);

            font_manage  = new Police_Size_Manage(height, width, _screen);
            font_bold    = font_manage.Get_Bold_Font();
            font_regular = font_manage.Get_Regular_Font();

            position_play = new Vector2((float)(width * 0.05), (float)(height * 0.7));
            position_quit = new Vector2((float)(width * 0.55), (float)(height * 0.7));

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

            bouton_1 = new Bouton(_screen, r1, font_regular, string_rejouer, marge, 0, Color.White, color_font, font_manage._scale);
            bouton_2 = new Bouton(_screen, r2, font_regular, string_quit, marge, 0, Color.White, color_font, font_manage._scale);


            if (_multi)
            {
                string   _id          = (string)IsolatedStorageSettings.ApplicationSettings ["id"];
                string[] data         = _info_fin_partie.Split('_');
                bool     _is_joueur_1 = false;
                if (data [3] == _id)
                {
                    _is_joueur_1 = true;
                }
                if ((_is_joueur_1 && data [2] == "1") || (!_is_joueur_1 && data [2] == "3"))
                {
                    _win  = true;
                    _draw = false;
                }
                else if (data [2] == "2")
                {
                    _draw = true;
                    _win  = false;
                }
                else
                {
                    _draw = false;
                    _win  = false;
                }

                if (_is_joueur_1)
                {
                    _point_1 = data [4];
                    _point_2 = data [5];
                }
                else
                {
                    _point_1 = data [5];
                    _point_2 = data [4];
                }
                position_point_1 = new Vector2((float)(width * 0.25 - font_bold.MeasureString(_point_1).X *font_manage._scale / 2), (float)(height * 0.15));
                position_point_2 = new Vector2((float)(width * 0.75 - font_bold.MeasureString(_point_2).X *font_manage._scale / 2), (float)(height * 0.15));

                _old_elo  = (string)IsolatedStorageSettings.ApplicationSettings ["elo"];
                _old_rank = (string)IsolatedStorageSettings.ApplicationSettings ["rank"];
                _name     = (string)IsolatedStorageSettings.ApplicationSettings ["name"];
                _new_elo  = data [0];
                _new_rank = data [1];

                int _diff_elo  = int.Parse(_new_elo) - int.Parse(_old_elo);
                int _diff_rank = int.Parse(_new_rank) - int.Parse(_old_rank);
                if (_diff_elo > 0)
                {
                    _difference_elo = "+" + _diff_elo.ToString();
                }
                else
                {
                    _difference_elo = _diff_elo.ToString();
                }

                if (_diff_rank > 0)
                {
                    _difference_rank = (_diff_rank - _diff_rank * 2).ToString();
                }
                else
                {
                    _difference_rank = "+" + (-_diff_rank).ToString();
                }
                IsolatedStorageSettings.ApplicationSettings ["elo"]  = _new_elo;
                IsolatedStorageSettings.ApplicationSettings ["rank"] = _new_rank;
            }
            else
            {
                _name     = (string)IsolatedStorageSettings.ApplicationSettings ["name"];
                _new_elo  = (string)IsolatedStorageSettings.ApplicationSettings ["elo"];
                _new_rank = (string)IsolatedStorageSettings.ApplicationSettings ["rank"];

                if (_new_elo == null)
                {
                    _new_elo = "";
                }
                if (_new_rank == null)
                {
                    _new_rank = "";
                }
            }
        }
 private void Reset_Bouton_Phase_2()
 {
     bouton_1 = new Bouton(_screen, r1, font_regular, string_retour_file_attente, marge, 0, Color.White, color_bouton, font_manage._scale);
     bouton_2 = new Bouton(_screen, r2, font_regular, string_menu, marge, 0, Color.White, color_bouton, font_manage._scale);
 }