Overview
Thecircles class creates a simple, static circular shape on the screen. As noted in the source code, it’s described as “a simple useless circle” - primarily for testing and basic visual elements.
Constructor
Parameters
The pygame surface to which the circle will be drawn.
The center position of the circle.
The radius of the circle in pixels.
RGB color tuple for the circle (default is black).
Methods
draw()
Draws the circle to the surface at the specified position.pygame.draw.circle() with the configured position, radius, and color.
Attributes
surface- The pygame surface to draw onpos- Center position as vec2dradius- Circle radius in pixelsbgcolor- RGB color tuple for the circle
Usage Example
Fromgame.py:
Notes
- The circle is static and does not move on its own
- Unlike
movingRect, this widget has no built-in animation or movement - Default radius is 5 pixels
- Default color is black (0, 0, 0)
- Position represents the circle’s center point, not top-left corner
- Useful for markers, dots, or simple visual elements