954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

click rect help

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

wolfeater017
Light Poster
35 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

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)

jimothy
Newbie Poster
14 posts since Dec 2009
Reputation Points: 10
Solved Threads: 5
 

actual code would be nice

wolfeater017
Light Poster
35 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

See the yesterdays post of vegaseat in the GUI thread.

pyTony
pyMod
Moderator
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852
 

shouldn't I be able to do something like this

M = pygame.mouse.get_pos
if M == textRect.collidepoint:
    print('I win')
wolfeater017
Light Poster
35 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: