Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to get a mouse press not hold in pygame

class Button(object):
    def __init__(self,x,y,width,height,color):
        self.rect = pygame.Rect(x,y,width,height)
        self.image=pygame.draw.rect(screen, color,(self.rect),)
        self.x=x
        self.y=y
        self.width=width
        self.height=height

    def check(self):
        return self.rect.collidepoint(pygame.mouse.get_pos())
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mouse #press #hold #pygame
ADD COMMENT
Topic
Name
3+9 =