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

Recommended Answers

All 4 Replies

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)

actual code would be nice

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.