コード例 #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();
        }
コード例 #2
0
ファイル: IntroClass.cs プロジェクト: Paulalex85/Red-VS-Green
        private void LoadContent()
        {
            width  = _screen.ScreenManager.GraphicsDevice.Viewport.Width;
            height = _screen.ScreenManager.GraphicsDevice.Viewport.Height;

            _r      = new Rectangle(0, 0, (int)(width / 2), height);
            red_t   = rectangle.Texture_Rounded_Rectangle(_screen.ScreenManager.GraphicsDevice, (int)(width * 0.75), (int)(height * 2), color_red, 0, 0);
            green_t = rectangle.Texture_Rounded_Rectangle(_screen.ScreenManager.GraphicsDevice, (int)(width * .75), (int)_r.Height, color_green, 0, 0);

            font_manage = new Police_Size_Manage(height, width, _screen);
            font_bold   = font_manage.Get_Regular_Font();
            font_35     = font_manage.Get_Bold_Gros2_Font();


            _timer_fade_out      = new Compteur_Time(_temps_Finish_Fade_Out - _temps_Fade_Out_Player);
            _timer_fade_out_fond = new Compteur_Time(_temps_End - _temps_Finish_Fade_Out);

            bool _add_deja_fait = false;

            if (_data [2] != null && _data [2] != "")
            {
                string fin_string = _data [2].Substring(_data [2].Length - 3, 3);
                if (fin_string == "pts")
                {
                    _add_deja_fait = true;
                }
            }
            else if (_data [5] != null && _data [5] != "")
            {
                string fin_string = _data [5].Substring(_data [5].Length - 3, 3);
                if (fin_string == "pts")
                {
                    _add_deja_fait = true;
                }
            }

            if (!_add_deja_fait)
            {
                if (langue.lang == "FR")
                {
                    if (_data [1] != "")
                    {
                        if (_data [1] == "1")
                        {
                            _data [1] = _data [1] + "er";
                        }
                        else
                        {
                            _data [1] = _data [1] + "ème";
                        }
                    }

                    if (_data [4] != "")
                    {
                        if (_data [4] == "1")
                        {
                            _data [4] = _data [4] + "er";
                        }
                        else
                        {
                            _data [4] = _data [4] + "ème";
                        }
                    }
                }
                else
                {
                    if (_data [1] != "")
                    {
                        if (_data [1] == "1")
                        {
                            _data [1] = _data [1] + "st";
                        }
                        else if (_data [1] == "2")
                        {
                            _data [1] = _data [1] + "nd";
                        }
                        else
                        {
                            _data [1] = _data [1] + "th";
                        }
                    }

                    if (_data [4] != "")
                    {
                        if (_data [4] == "1")
                        {
                            _data [4] = _data [4] + "st";
                        }
                        else if (_data [4] == "2")
                        {
                            _data [4] = _data [4] + "nd";
                        }
                        else
                        {
                            _data [4] = _data [4] + "th";
                        }
                    }
                }

                if (_data [2] != "")
                {
                    _data [2] = _data [2] + "pts";
                }
                if (_data [5] != "")
                {
                    _data [5] = _data [5] + "pts";
                }
            }

            _red_name = new Info_Intro(_data[0], new Vector2((float)(0 - font_bold.MeasureString(_data[0]).X *font_manage._scale), (float)(height * 0.2)), true, _screen, font_bold);
            _red_rank = new Info_Intro(_data[1], new Vector2((float)(0 - font_bold.MeasureString(_data[1]).X *font_manage._scale), (float)(height * 0.25)), true, _screen, font_bold);
            _red_elo  = new Info_Intro(_data[2], new Vector2((float)(0 - font_bold.MeasureString(_data[2]).X *font_manage._scale), (float)(height * 0.3)), true, _screen, font_bold);

            _green_name = new Info_Intro(_data[3], new Vector2((float)(width), (float)(height * 0.7)), false, _screen, font_bold);
            _green_rank = new Info_Intro(_data[4], new Vector2((float)(width), (float)(height * 0.75)), false, _screen, font_bold);
            _green_elo  = new Info_Intro(_data[5], new Vector2((float)(width), (float)(height * 0.8)), false, _screen, font_bold);

            _position_destination_X_red   = (float)(width * 0.1);
            _position_destination_X_green = (float)(width * 0.65);
        }