Pygame de köşesi yumuşatılmış kare nasıl yapabilirim

Birazcık araştırdım fakat pek bi sonuca varamadım

böylemi hocam ?

import pygame
import sys

pygame.init()

# Ekran boyutu
width, height = 500, 500
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption("https://forum.yazbel.com/")

clock = pygame.time.Clock()


white = (255, 255, 255)
black = (0, 0, 0)

def draw_rounded_rect(surface, color, rect, radius):
    pygame.draw.rect(surface, color, rect, border_radius=radius)

def main():
    running = True
    radius = 20
    rect = pygame.Rect(50, 50, 200, 200)

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

        screen.fill(white)

        # Yumusak Kare
        draw_rounded_rect(screen, black, rect, radius)

        pygame.display.flip()
        clock.tick(60)

    pygame.quit()
    sys.exit()

if __name__ == "__main__":
    main()

2 Beğeni

Hocam teşekkürler çok yardımcı oldunuz