0

I am trying to put an image of a shop icon on a screen, but it has the vector grid as well!

Does anyone know how to only keep the black icon on the screen?

here is the image

Here is my code:

import pygame
pygame.init()

win = pygame.display.set_mode((1366, 768))
pygame.display.set_caption("Pygame-1")

house_icon_img = pygame.image.load("house icon.png").convert_alpha()
shop_icon_img = pygame.image.load("shop icon.png").convert_alpha()

class Button():
    def __init__(self, x, y, image):
        self.image = image
        self.rect = self.image.get_rect()
        self.rect.topleft = (x, y)

    def draw(self):
        win.blit(self.image, (self.rect.x, self.rect.y))
        shop_button = Button(100, 200, shop_icon_img)
        house_button = Button(450, 200, house_icon_img)

    run = True
    while run:
        win.fill((202, 228, 241))

    shop_button.draw()
    #house_button.draw()

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            run = False



    pygame.display.update()



    pygame.quit()
quagrain
  • 55
  • 5
  • I suppose there may always be a background? Do you mean a default background white or something? – x pie Jul 14 '22 at 00:58
  • The usual way is to [blit](https://www.pygame.org/docs/ref/surface.html#pygame.Surface.blit) portions of the image to screen. – martineau Jul 14 '22 at 01:13

0 Answers0