Description
I'm pleased to inform you that the pygame-geometry
library has started being ported to the pygame-ce
repository.
The primary goal is to enhance the functionality of the library by introducing several new types of shapes, while retaining the familiar features found in pygame's Rect
or Frect
classes.
The main portion of the functionality consists of the following shape classes:
Circle
Line
Polygon
Each shape includes the following:
- Transformation functions such as scale, rotate, move, and update.
- Collision functions, allowing each shape to collide with other shapes, as well as points, Rects, and Frects.
- A variety of utility and situational methods.
Please note that the current pygame-geometry codebase may contain functionality that will not be included in the port or may undergo significant modifications.
If you are interested in exploring the complete codebase for the project or help with the port, you can find it here:
Integration Progress
The integration is happening in phases, starting with Circle and later Line and Polygon. Each shape will then be slowly built upon piece by piece.
At the moment the Line object is being actively ported
- geometry module base:
geometry
module,Circle
base #2268 -
pg_DoubleFromObj
/pg_TwoDoublesFromObj
C api:geometry
module,Circle
base #2268
Circle
-
Circle
object:geometry
module,Circle
base #2268
Attributes
-
x
:geometry
module,Circle
base #2268 -
y
:geometry
module,Circle
base #2268 -
r
:geometry
module,Circle
base #2268 -
r_sqr
: Added missing Circle attrs #2519 -
diameter
/d
: Added missing Circle attrs #2519 -
center
: Added missing Circle attrs #2519 -
area
: Added missing Circle attrs #2519 -
circumference
: Added missing Circle attrs #2519 -
top
/bottom
/left
/right
: Added additional circle attributes #3127
Methods
-
copy()
:geometry
module,Circle
base #2268 -
repr
/str
/print
:geometry
module,Circle
base #2268 -
move
/move_ip
: Add Circlemove()
/move_ip()
#2561 -
update
: Add Circleupdate()
#2562 -
as_rect
/as_frect
: Add Circleas_rect()
/as_frect()
#2634 -
rotate / rotate_ip
: Add Circlerotate()
/rotate_ip()
#2662 -
collidepoint
: Add Circlecollidepoint()
#2536 -
collidecircle
: Add Circlecollidecircle()
#2540 -
colliderect
: Add Circlecolliderect()
#2560 -
collideswith
: Add Circlecollideswith()
#2661 -
contains
: Add Circlecontains()
#2791 -
collidelist / collidelistall
: AddCircle.collidelist/collidelistall()
#2880 -
intersect
: AddCircle.intersect()
#3071 -
collideline
-
collidepolygon
Line
-
Line
object: Addedgeometry.Line
base #3131
Attributes
-
ax
,ay
,bx
,by
Addedgeometry.Line
base #3131 -
a
,b
Addedgeometry.Line
base #3131 -
center
: Add moreLine
attributes #3268 -
centerx
,centery
: Add moreLine
attributes #3268 -
length
: AddedLine
methods andlength
attribute #3179 -
angle
: Add moreLine
attributes #3268 -
slope
: Add moreLine
attributes #3268
Methods
-
move
/move_ip
: AddedLine
methods andlength
attribute #3179 -
rotate
/rotate_ip
-
scale
/scale_ip
: AddedLine
methods andlength
attribute #3179 -
flip_ab
/flip_ab_ip
: AddedLine
methods andlength
attribute #3179 -
update
: AddedLine
methods andlength
attribute #3179 -
copy
: Addedgeometry.Line
base #3131 -
collidepoint
-
collidecircle
-
collideline
-
colliderect
-
collidepolygon
-
collideswith
-
as_circle
-
as_rect
-
is_parallel
-
is_perpendicular
-
at
-
as_segments
-
as_points
-
collidelist / collidelistall
-
intersect
Polygon
-
Polygon
object
Attributes
-
vertices
-
verts_num
-
center
-
centerx
,centery
-
perimeter
-
area
Methods
-
move
/move_ip
-
copy
-
collidepoint
-
collideline
-
collidecircle
-
insert_vertex
-
remove_vertex
-
pop_vertex
-
is_convex
-
scale
/ scale_ip -
as_segments
-
as_rect
-
rotate
/rotate_ip
-
collidelist / collidelistall
-
intersect
Rect & Frect
Methods
-
collidecircle
: Add(F)Rect.collidecircle()
#2886 -
collideline
-
collidepolygon
-
collideswith
-
as_polygon
Other
-
regular_polygon
-
raycast
-
multiraycast
- Integrate
Circle
into draw.circle - Integrate
Line
into draw.line - Integrate
Polygon
into draw.polygon