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();
        }
Exemplo n.º 2
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();
        }