import pygame
from Display.display import Display
# handles creation of button images and selecting them
class Button():
    def __init__(self, image, position, size):
        self.display = Display()
        # create surface
        self.image = image

        # get image size and position
        self.rect = pygame.Rect(position, size)

    def draw(self):
        # draw image on rect
        self.display.win.blit(self.image, self.rect)

    def event_handler(self, event, function):
        # listening for event for start button
        if event.type == pygame.MOUSEBUTTONDOWN:
            # if left mouse clicked
            if event.button == 1:
                # if you hover over button
                if self.rect.collidepoint(event.pos):
                    function()
2786986c409906262f0d850c9f5f5e9ee037f72e
<mask token>


class Button:
    <mask token>
    <mask token>
    <mask token>

<mask token>


class Button:

    def __init__(self, image, position, size):
        self.display = Display()
        self.image = image
        self.rect = pygame.Rect(position, size)

    def draw(self):
        self.display.win.blit(self.image, self.rect)
    <mask token>

<mask token>


class Button:

    def __init__(self, image, position, size):
        self.display = Display()
        self.image = image
        self.rect = pygame.Rect(position, size)

    def draw(self):
        self.display.win.blit(self.image, self.rect)

    def event_handler(self, event, function):
        if event.type == pygame.MOUSEBUTTONDOWN:
            if event.button == 1:
                if self.rect.collidepoint(event.pos):
                    function()

import pygame
from Display.display import Display


class Button:

    def __init__(self, image, position, size):
        self.display = Display()
        self.image = image
        self.rect = pygame.Rect(position, size)

    def draw(self):
        self.display.win.blit(self.image, self.rect)

    def event_handler(self, event, function):
        if event.type == pygame.MOUSEBUTTONDOWN:
            if event.button == 1:
                if self.rect.collidepoint(event.pos):
                    function()

import pygame
from Display.display import Display
# handles creation of button images and selecting them
class Button():
    def __init__(self, image, position, size):
        self.display = Display()
        # create surface
        self.image = image

        # get image size and position
        self.rect = pygame.Rect(position, size)

    def draw(self):
        # draw image on rect
        self.display.win.blit(self.image, self.rect)

    def event_handler(self, event, function):
        # listening for event for start button
        if event.type == pygame.MOUSEBUTTONDOWN:
            # if left mouse clicked
            if event.button == 1:
                # if you hover over button
                if self.rect.collidepoint(event.pos):
                    function()