예제 #1
0
void GameWinDialog::paintContent(QPainter &p)
{
  GamePanel::paintContent(p);

  p.setOpacity(1);
  p.setFont(gameStock->Font60);
  p.setPen(QPen(QColor(0x030055)));

  drawHCentered(p, 50, tr("You're the Winner!"));

  p.setFont(gameStock->Font40);

  drawHCentered(p, 200, tr("You finished all the levels!"));

  p.setFont(gameStock->Font20);

  const int y30 = DY(40);

  const int x1 = DX(300), x2 = DX(420), x3 = DX(600);
  const int /*y1 = DY(250), */y2 = DY(350)/*, y3 = DY(350)*/;

  p.drawPixmap(x1,y2, gameStock->Score);
  p.drawText(x3,y2+y30, QString::number(score));

  p.setPen(QPen(Qt::black));
  p.drawText(x2,y2+y30, tr("Score:"));
}
예제 #2
0
void LevelFailDialog::paintContent(QPainter &p)
{
  GamePanel::paintContent(p);

  p.setOpacity(1);
  p.setFont(gameStock->Font40);
  p.setPen(QPen(QColor(0x030055)));

  drawHCentered(p, 50, tr("Level %1 failed :(").arg(level));

  p.setFont(gameStock->Font20);

  drawHCentered(p, 250, tr("Hope next time you'll do it better..."));
}
예제 #3
0
void LevelWinDialog::paintContent(QPainter &p)
{
  GamePanel::paintContent(p);

  p.setOpacity(1);
  p.setFont(gameStock->Font40);
  p.setPen(QPen(QColor(0x030055)));

  drawHCentered(p, 50, tr("Level %1 completed!").arg(level));

  p.setFont(gameStock->Font20);

  const int y30 = DY(40);

  const int x1 = DX(300), x2 = DX(380), x3 = DX(600);
  const int y1 = DY(250), y2 = DY(350);

  p.drawPixmap(x1,y1, gameStock->Clock);
  p.drawText(x3,y1+y30, QString("%1:%2").arg(time/60, 2, 10, QChar('0')).arg(time%60, 2, 10, QChar('0')));

  p.drawPixmap(x1,y2, gameStock->Score);
  p.drawText(x3,y2+y30, QString::number(score));

  p.setPen(QPen(Qt::black));
  p.drawText(x2,y1+y30, tr("Time left:"));
  p.drawText(x2,y2+y30, tr("Score:"));
}
예제 #4
0
/** The drawing method
  *
  * It simply call the right drawing method according to the type of
  * the caption.
  */
void RainbruRPG::Terminal::Caption::draw(){
  switch(type){
  case H_CENTERED:
    drawHCentered();
    break;

  case WORD_WRAPPED:
    drawWordWrapped();
    break;

  }
}