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 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()