# -*- coding: utf-8 -*-
# Utility for creating a button
import pygame
class Button() :
    def __init__(self, x, y, image, screen) :
        self.image = image
        self.screen = screen
        self.rect = self.image.get_rect()
        self.rect.topleft = [x, y]
        
    def draw(self) :
        # Get mouse position
        pos = pygame.mouse.get_pos()
        
        # Check if mouse is over the button
        if self.rect.collidepoint(pos) :
            if pygame.mouse.get_pressed()[0] == 1:
                return True
        # Draw button
        self.screen.blit(self.image, (self.rect.x, self.rect.y))
        return False
        

894eddc067487c56f05d94cc6fb055163d19cfbd
<mask token>


class Button:
    <mask token>
    <mask token>

<mask token>


class Button:

    def __init__(self, x, y, image, screen):
        self.image = image
        self.screen = screen
        self.rect = self.image.get_rect()
        self.rect.topleft = [x, y]
    <mask token>

<mask token>


class Button:

    def __init__(self, x, y, image, screen):
        self.image = image
        self.screen = screen
        self.rect = self.image.get_rect()
        self.rect.topleft = [x, y]

    def draw(self):
        pos = pygame.mouse.get_pos()
        if self.rect.collidepoint(pos):
            if pygame.mouse.get_pressed()[0] == 1:
                return True
        self.screen.blit(self.image, (self.rect.x, self.rect.y))
        return False

import pygame


class Button:

    def __init__(self, x, y, image, screen):
        self.image = image
        self.screen = screen
        self.rect = self.image.get_rect()
        self.rect.topleft = [x, y]

    def draw(self):
        pos = pygame.mouse.get_pos()
        if self.rect.collidepoint(pos):
            if pygame.mouse.get_pressed()[0] == 1:
                return True
        self.screen.blit(self.image, (self.rect.x, self.rect.y))
        return False

# -*- coding: utf-8 -*-
# Utility for creating a button
import pygame
class Button() :
    def __init__(self, x, y, image, screen) :
        self.image = image
        self.screen = screen
        self.rect = self.image.get_rect()
        self.rect.topleft = [x, y]
        
    def draw(self) :
        # Get mouse position
        pos = pygame.mouse.get_pos()
        
        # Check if mouse is over the button
        if self.rect.collidepoint(pos) :
            if pygame.mouse.get_pressed()[0] == 1:
                return True
        # Draw button
        self.screen.blit(self.image, (self.rect.x, self.rect.y))
        return False
        
