how do you get it in pygame so that when you click on a rect it will reset the window but only when you click on that certain rect

make it so that if the position of the mouse is equal to somewhere within the rectangle AND if the mouse is clicked then do something-(relpy to me if you want actual code)

See the yesterdays post of vegaseat in the GUI thread.

shouldn't I be able to do something like this

M = pygame.mouse.get_pos
if M == textRect.collidepoint:
    print('I win')
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.