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); }
void HippoBubble::doShow(void) { show(FALSE); SetTimer(window_, CHECK_MOUSE, 250 /* 0.25 second */, NULL); checkMouse(); }
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; }
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); }
void MaskStriple::mousePressEvent(QMouseEvent *event) { checkMouse(event); QWidget::mousePressEvent(event); }