Esempio n. 1
0
 public void NextTurn(Player player)
 {
     lblName.Text = player.Name;
     lblName.Font = new Font(lblName.Font.Name, lblName.Font.Size, lblName.Font.Style);
     Bitmap Avatar = player.getAvatar(0);
     pbAvatar.Size = new Size((int)(Avatar.Size.Width * 6 / 5 * width_ratio), (int)(Avatar.Size.Height * 6 / 5 * height_ratio));
     pbAvatar.BackgroundImage = Avatar;
     pbDice.Image = drawDice(gDice, diceBitmap, (int)(5 * (width_ratio + height_ratio) / 2), new Pen(Color.Black), new SolidBrush(Color.Black), 0);
     Bitmap power = new Bitmap(Image.FromFile("power" + player.Power + ".png"));
     pbPower.BackgroundImage = power;
     lblPower.Font = new Font(lblPower.Font.Name, lblPower.Font.Size, lblPower.Font.Style);
     lblPower.Text = "Power: " + player.Power + "/4";
     for (int i = 0; i < GameBoard.Count; i++)
     {
         Bitmap currentAvatar;
         if (i == GameBoard.Active)
             currentAvatar = GameBoard[i].getAvatar(1);
         else
             currentAvatar = GameBoard[i].getAvatar(-1);
         if (GameBoard[i].AvatarNumber == 3)
             gDisplay.DrawImage(currentAvatar, 25 * width_ratio, (i * 72 + 20 + i * 15) * height_ratio, 65 * width_ratio, 72 * height_ratio);
         else if (GameBoard[i].AvatarNumber == 1)
             gDisplay.DrawImage(currentAvatar, 8 * width_ratio, (i * 72 + 20 + i * 15) * height_ratio, 60 * width_ratio, 72 * height_ratio);
         else if (GameBoard[i].AvatarNumber == 0)
             gDisplay.DrawImage(currentAvatar, 10 * width_ratio, (i * 72 + 20 + i * 15) * height_ratio, 65 * width_ratio, 72 * height_ratio);
         else
             gDisplay.DrawImage(currentAvatar, 15 * width_ratio, (i * 72 + 15 + i * 15) * height_ratio, 60 * width_ratio, 72 * height_ratio);
         gDisplay.DrawString(GameBoard[i].Name, new Font("Times New Roman", 14 * (width_ratio + height_ratio) / 2, FontStyle.Regular), new SolidBrush(Color.Black), 80 * width_ratio, (i * 72 + 20 + i * 15) * height_ratio);
         gDisplay.DrawImage(Image.FromFile("power" + GameBoard[i].Power + ".png"), 80 * width_ratio, ((i * 72 + 20 + i * 15) + 20) * height_ratio, 70 * width_ratio, 20 * height_ratio);
     }
     pbPlayers.Image = displayBitmap;
     //width_ratio = 1;
     //height_ratio = 1;
 }