All pastes #161629 Raw Edit

Gus

public text v1 · immutable
·published 2006-09-05 17:19 UTC
rendered paste body
void Panel::displayPlayerInfo(int team_id, int player_id)
{
  if (showing_player_info_)
    hidePlayerInfo();

  g_.getApi()->select_team(team_id);
  const CPlayer* p = g_.getApi()->getPlayer(player_id);

  player_picture_ = Surface(std::string("image/figs/") + p->getPlayerPicture());
  player_picture_.setPos(45, 150);
  addChild(&player_picture_);

  // Creating the images for each figure
  Sprite number;
  number.load("image/panel/digits_time.png");
  number.splitNbFrame(10,1);
  int dizaines;

  int ma_=p->getMa();
  Sprite number_ma_1, number_ma_2;
  number_ma_1 = number;
  number_ma_2 = number;
  // Printing MA
  if (ma_<10)
  {
    number_ma_1.hide();
    number_ma_2.setPos(220,154);
    number_ma_2.setFrame(ma_+1);
  }
  else
  {
    dizaines = ma_/10;
    number_ma_1.show();
    number_ma_1.setPos(212,154);
    number_ma_2.setPos(227,154);
    number_ma_1.setFrame(dizaines+1);
    number_ma_2.setFrame(ma_-dizaines*10+1);
  }
  addChild(&number_ma_1);
  addChild(&number_ma_2);

  // Printing ST


  // Printing AG


  // Printing AV

  showing_player_info_ = true;
}