Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Draw a circle using Arcade in Python3
Arcade is a Python library used to create 2D games and applications. It provides easy-to-use functionality for drawing shapes and images on the screen. In this article, we will learn how to draw circles using Arcade in Python3.
Installing Arcade
Before drawing circles, install the Arcade library using pip ?
pip install arcade
Method 1: Using arcade.draw_circle_filled()
The most straightforward way to draw a circle is using the draw_circle_filled() method.
Syntax
arcade.draw_circle_filled(x, y, radius, color)
Parameters
x ? The x-coordinate of the circle's center point
y ? The y-coordinate of the circle's center point
radius ? The radius of the circle
color ? The color as an arcade.color constant, RGB tuple, or RGBA tuple
Example
Here's a complete example that creates a window and draws a red circle ?
import arcade # Set up the window WIDTH = 640 HEIGHT = 480 window = arcade.open_window(WIDTH, HEIGHT, "Drawing a Circle") # Set the background color arcade.set_background_color(arcade.color.WHITE) # Start the render process arcade.start_render() # Draw a red circle in the center of the screen x = WIDTH // 2 y = HEIGHT // 2 radius = 100 color = arcade.color.RED arcade.draw_circle_filled(x, y, radius, color) # Finish the render process and display the window arcade.finish_render() arcade.run()
Output

Method 2: Using arcade.draw_ellipse_filled()
You can also draw a circle using draw_ellipse_filled() by setting equal width and height values.
Syntax
arcade.draw_ellipse_filled(x, y, width, height, color)
Parameters
x ? The x-coordinate of the ellipse's center point
y ? The y-coordinate of the ellipse's center point
width ? The width of the ellipse
height ? The height of the ellipse
color ? The color specification
Example
This example draws a blue circle using the ellipse function with equal width and height ?
import arcade # Set up the window WIDTH = 640 HEIGHT = 480 window = arcade.open_window(WIDTH, HEIGHT, "Drawing a Circle with Ellipse") # Set the background color arcade.set_background_color(arcade.color.WHITE) # Start the render process arcade.start_render() # Draw a blue circle using the ellipse function x = WIDTH // 2 y = HEIGHT // 2 width = 200 height = 200 # Same as width to make it a circle color = arcade.color.BLUE arcade.draw_ellipse_filled(x, y, width, height, color) # Finish the render process and display the window arcade.finish_render() arcade.run()
Output

Drawing Multiple Circles
You can draw multiple circles with different colors and sizes ?
import arcade # Set up the window WIDTH = 640 HEIGHT = 480 window = arcade.open_window(WIDTH, HEIGHT, "Multiple Circles") # Set the background color arcade.set_background_color(arcade.color.WHITE) # Start the render process arcade.start_render() # Draw multiple circles arcade.draw_circle_filled(200, 300, 50, arcade.color.RED) arcade.draw_circle_filled(320, 300, 75, arcade.color.GREEN) arcade.draw_circle_filled(440, 300, 60, arcade.color.BLUE) # Finish the render process and display the window arcade.finish_render() arcade.run()
Comparison
| Method | Function | Best For |
|---|---|---|
| Direct Circle | draw_circle_filled() |
Simple circles, cleaner code |
| Ellipse Method | draw_ellipse_filled() |
When you need ellipses too |
Conclusion
Arcade provides simple methods to draw circles using draw_circle_filled() or draw_ellipse_filled(). Both methods require setting up a window, background, and rendering process. Use draw_circle_filled() for straightforward circle drawing.
