By box or rectangle I do not refer to the rect drawn by me. I want to know if a user clicked in a place. I am making a tic tac toe program and I want to register the click. i have been using this
Vector2i winpos = Mouse::getPosition(window);
int loc_x = winpos.x;
int loc_y = winpos.y;
INPUT:
if (Mouse::isButtonPressed(Mouse::Left)) {
if (72 < loc_x < 250 && 600 < loc_y < 500) {
cout << "works" << endl;
}
}
also i have placed this code inside the while loop
it should cout "works" in the cmd when i click in the first block but gives me "works" everytime i click inside
the window. it should not do that. it should only gimme works if mouse clicks in 1st cell/block.
look picture for clarification.