close

How to draw a circle in PyGame?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How to draw a circle in PyGame in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How to draw a circle in PyGame?

  1. How to draw a circle in PyGame?

    You've mistyped the name of the function. The correct name is pygame.draw.circle.

  2. draw a circle in PyGame

    You've mistyped the name of the function. The correct name is pygame.draw.circle.

Method 1

You’ve mistyped the name of the function. The correct name is pygame.draw.circle.

def drawCircle():
    pos=getPos()
    pygame.draw.circle(screen, BLUE, pos, 20) # Here <<<

Method 2

Here is how you can draw a circle in pygame;

import pygame
pygame.init()
screen = pygame.display.set_mode((x, y)) #x and y are height and width

pygame.draw.circle(screen, (r,g,b), (x, y), R, w) #(r, g, b) is color, (x, y) is center, R is radius and w is the thickness of the circle border.

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read