I want to put the quit button in the game code in pygame, but I know how to turn off the game program by putting the quit button. The problem is that I wanted to change the color when I was clicking the quit button, so I made another darker picture, but I don't know the code for "When I'm clicking." Can I know the code when I click on Python?
python button
This is when the mouse button is clicked with pygame.MOUSEBUTTONDOWN
.
This is when you release the mouse button with pygame.MOUSEBUTTONUP
.
That's when you click until you release the mouse.
© 2024 OneMinuteCode. All rights reserved.