Exemplo n.º 1
0
void Gui::step(sf::RenderWindow& window) {

  //rechecks mouse position
  mouseX = sf::Mouse::getPosition(window).x;
  mouseY = sf::Mouse::getPosition(window).y;
  if (game.currentPlayer) {
    checkMouse(window, p1Units);
  }
  else {
    checkMouse(window, p2Units);
  }
  drawTexts(window);
  drawRangeCircle(window);
}
Exemplo n.º 2
0
void
HippoBubble::doShow(void) 
{   
    show(FALSE);

    SetTimer(window_, CHECK_MOUSE, 250 /* 0.25 second */, NULL);
    checkMouse();
}
Exemplo n.º 3
0
int handleEvent(SDL_Event *event, SDL_Rect buttonPlacement[], int *select, int *mode, int modeMaxButtons[], int *keyboardMode, bool *quit){
    if(event->type == SDL_QUIT)
        *quit = true;
    else if(event->type == SDL_MOUSEBUTTONDOWN || event->type == SDL_MOUSEMOTION)
        checkMouse(event, buttonPlacement, select, mode, modeMaxButtons, keyboardMode, quit);
    else if(event->type == SDL_KEYDOWN) //|| event->type == SDL_TEXTINPUT)
        checkKeypress(event, mode, keyboardMode, select);
    return 0;
}
Exemplo n.º 4
0
bool 
HippoBubble::processMessage(UINT   message,
                            WPARAM wParam,
                            LPARAM lParam)
{
    if (message == WM_TIMER && wParam == CHECK_MOUSE) {
        checkMouse();
        return true;
    }

    return HippoAbstractWindow::processMessage(message, wParam, lParam);
}
Exemplo n.º 5
0
void MaskStriple::mousePressEvent(QMouseEvent *event)
{
    checkMouse(event);
    QWidget::mousePressEvent(event);
}