Ejemplo n.º 1
0
 private void FighterSelect_Load(object sender, EventArgs e)
 {
     foreach (Fighter f in fighters)
     {
         FighterModel pb = new FighterModel(f);
         pb.BackgroundImage       = Image.FromFile(f.ImgPath);
         pb.BackgroundImageLayout = ImageLayout.Zoom;
         pb.BackColor             = Color.Red;
         pb.Size   = new Size(70, 70);
         pb.Click += FighterClick;
         flowLayoutPanel1.Controls.Add(pb);
     }
 }
Ejemplo n.º 2
0
        private void FighterClick(object sender, EventArgs e)
        {
            if (opponent != null)
            {
                return;
            }
            button1.Enabled = true;
            FighterModel fm = (FighterModel)sender;

            pictureBox1.BackgroundImage = fm.BackgroundImage;
            Fighter f = fm.Fighter;

            this.fighter      = f;
            label1.Text       = f.Name; //286
            pictureBox3.Width = (int)(f.Health / 500.0 * 286);
            pictureBox5.Width = (int)(f.Damage / 101.0 * 286);
            label3.Text       = f.OtherData;
        }