void ribi::QtBeerWanterWidget::onTimer()
{
  m_dialog->ShakeCursor();

  const int mouse_x = m_dialog->GetCursorX();
  const int mouse_y = m_dialog->GetCursorY();
  //#define DEBUG_SHOW_MOUSE_TIMER_POSITION
  #ifdef DEBUG_SHOW_MOUSE_TIMER_POSITION
  m_debug_text
    = "ONTIMER: ("
    + boost::lexical_cast<std::string>(mouse_x)
    + ","
    + boost::lexical_cast<std::string>(mouse_y)
    + ")";
  #endif

  const QPoint base_pos = this->mapToGlobal(QPoint(0,0));
  #ifdef DEBUG_SHOW_MOUSE_TIMER_POSITION
  m_debug_text
    += "-> ("
    + boost::lexical_cast<std::string>(base_pos.x())
    + ","
    + boost::lexical_cast<std::string>(base_pos.y())
    + ")";
  #endif

  this->cursor().setPos(
    base_pos.x() + mouse_x,base_pos.y() + mouse_y);

  //Move window
  m_dialog->ShakeWindow();
  //QtBeerWanterWidget cannot shake itself
  emit DoShake(m_dialog->GetWindowX(),m_dialog->GetWindowY());
  this->repaint();
}
Beispiel #2
0
void Camera2D::DoBigShake()
{
	DoShake(60.0f, 0.45f);
}
Beispiel #3
0
void Camera2D::DoMediumShake()
{
	DoShake(15.0f, 0.30f);
}
Beispiel #4
0
void Camera2D::DoSmallShake()
{
	DoShake(10.0f, 0.16f);
}